etseidl commented on code in PR #9868:
URL: https://github.com/apache/arrow-rs/pull/9868#discussion_r3175699088
##########
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:
Nit: I think we can do without this in the docs. Perhaps a short comment
about safety above the call to `read_list_begin`
--
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]