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


##########
cpp/src/arrow/ipc/reader.cc:
##########
@@ -254,7 +254,12 @@ class ArrayLoader {
     if (i >= static_cast<int>(variadic_counts->size())) {
       return Status::IOError("variadic_count_index out of range.");
     }
-    return static_cast<size_t>(variadic_counts->Get(i));
+    int64_t count = variadic_counts->Get(i);
+    if (count < 0 || count > std::numeric_limits<int32_t>::max()) {
+      return Status::IOError(
+          "variadic_count must be represenable as a positive int32_t, got ", 
count, ".");

Review Comment:
   ```suggestion
             "variadic_count must be representable as a positive int32_t, got 
", count, ".");
   ```



-- 
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