Gabriel39 opened a new pull request, #66820:
URL: https://github.com/apache/doris/pull/66820

   ### What problem does this PR solve?
   
   Malformed Parquet metadata can encode internal Thrift container lengths that 
are much larger than the serialized message, causing generated readers to 
allocate excessive memory before deserialization fails.
   
   The legacy Parquet Bloom filter reader also trusts metadata-controlled 
offsets and sizes before allocation. A malformed filter can therefore cause 
excessive allocation, out-of-bounds block access, or incorrect pruning when a 
payload is truncated.
   
   ### What is changed?
   
   - Bound Thrift message, string, and container sizes by the serialized input 
length.
   - Validate legacy Parquet Bloom filter offsets, declared lengths, payload 
bounds, and 32-byte block alignment before allocation.
   - Require Bloom filter payload reads to return the complete validated 
payload.
   - Add regression tests for oversized Thrift containers and malformed Bloom 
filter layouts.
   
   ### Check list
   
   - [x] Added unit tests.
   - [x] Added comments for non-obvious safety invariants.
   - [x] Ran clang-format 16 on all affected C++ files.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to