ranflarion commented on code in PR #10522:
URL: https://github.com/apache/arrow-rs/pull/10522#discussion_r3705740399
##########
arrow-ipc/src/reader.rs:
##########
@@ -3866,4 +3910,56 @@ mod tests {
assert_eq!(read_batch.column(0).as_ref(), &values);
}
}
+
+ /// A message body length is read from the stream before any of the bytes
it describes,
+ /// so it cannot be trusted. Declaring an implausible one used to reserve
it outright,
+ /// and the resulting allocation failure aborts the process instead of
surfacing an error
+ /// the caller can handle.
+ #[test]
+ fn test_stream_reader_rejects_implausible_body_length() {
Review Comment:
added, test_stream_reader_rejects_truncated_body covers a 1024-byte declared
body backed by 10 bytes, which fails before the first growth step, and a
MAX_PREALLOC_BYTES + 1 body backed by exactly MAX_PREALLOC_BYTES, which fails
after one, so the resize path is exercised before hitting EOF.
--
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]