masumi-ryugo commented on code in PR #9868:
URL: https://github.com/apache/arrow-rs/pull/9868#discussion_r3175797082


##########
parquet/src/parquet_thrift.rs:
##########
@@ -680,14 +698,27 @@ impl<'a, R: ThriftCompactInputProtocol<'a>> 
ReadThrift<'a, R> for &'a [u8] {
 
 /// Read a Thrift encoded [list] from the input protocol object.
 ///
+/// The list `size` is read by [`ThriftCompactInputProtocol::read_list_begin`],
+/// which already rejects values above `i32::MAX`. The up-front allocation
+/// goes through [`Vec::try_reserve_exact`] so that an attacker-supplied
+/// `size` that is below `i32::MAX` but still too large to allocate produces
+/// a clean error instead of panicking inside the allocator.
+///

Review Comment:
   Done in d06933b — replaced the doc block with a 3-line safety comment 
immediately above `read_list_begin`. Diff vs base is now +60/-2.



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