pitrou commented on code in PR #45498:
URL: https://github.com/apache/arrow/pull/45498#discussion_r1952176572


##########
cpp/src/arrow/csv/parser_test.cc:
##########
@@ -621,6 +645,25 @@ TEST(BlockParser, MismatchingNumColumns) {
     EXPECT_RAISES_WITH_MESSAGE_THAT(
         Invalid, testing::HasSubstr("CSV parse error: Expected 2 columns, got 
1: a"), st);
   }
+  // Vary the number of columns and mismatch, to catch buffer overflow issues
+  for (int32_t num_cols : {1, 2, 5, 10, 100}) {

Review Comment:
   The conditions for triggering the issue are bit mysterious, so I thought it 
would be safer to ensure non-regression with a larger set of parameters. I can 
trim it down a bit of course.



##########
cpp/src/arrow/csv/parser_test.cc:
##########
@@ -621,6 +645,25 @@ TEST(BlockParser, MismatchingNumColumns) {
     EXPECT_RAISES_WITH_MESSAGE_THAT(
         Invalid, testing::HasSubstr("CSV parse error: Expected 2 columns, got 
1: a"), st);
   }
+  // Vary the number of columns and mismatch, to catch buffer overflow issues
+  for (int32_t num_cols : {1, 2, 5, 10, 100}) {
+    ARROW_SCOPED_TRACE("num_cols = ", num_cols);
+    for (int32_t mismatch : {-20, -5, -4, -1, 1, 2, 5, 10, 50, 1024, 32767}) {

Review Comment:
   Same answer as above :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to