adamreeve commented on code in PR #43269:
URL: https://github.com/apache/arrow/pull/43269#discussion_r1678770560


##########
csharp/src/Apache.Arrow/Ipc/ArrowStreamReaderImplementation.cs:
##########
@@ -132,7 +132,13 @@ protected ReadResult ReadMessage()
 
                 Flatbuf.Message message = 
Flatbuf.Message.GetRootAsMessage(CreateByteBuffer(messageBuff));
 
-                int bodyLength = checked((int)message.BodyLength);
+                if (message.BodyLength > int.MaxValue)

Review Comment:
   I don't think there's a need for more specific checks when importing 
individual arrays as this should cover all scenarios.
   
   I also tested reading data from Flight but that actually fails on the C++ 
server side with an error that > 2 GB record batches are not supported (see 
[FlightPayload::Validate](https://github.com/apache/arrow/blob/21238a7f5ebb224410d84ecf32dbe3556cab363a/cpp/src/arrow/flight/types.cc#L207)).



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