Repository navigation
fix(parquet): validate schema child count before allocation - #12025
huong8373tt-beep wants to merge 1 commit into
Conversation
Signed-off-by: Slai.life <huong8373tt@gmail.com>
|
Thank you for the contribution. The change may well be correct, but I am closing this PR under the arrow-rs guidance on AI generated submissions: https://github.com/apache/arrow-rs/blob/main/CONTRIBUTING.md#ai-generated-submissions Maintainer review time is the scarcest resource in this project. This account has recently opened many AI-generated PRs across many repositories. That suggests the changes aren't coming from someone who uses arrow-rs, and that no human will be around to discuss review feedback and maintain the code. Reviewing PRs like this costs us more time than it saves. If you do use arrow-rs and this fix matters to you, please re-open this as a focused PR with a short description in your own words, one you have reviewed and understand, and we'd be happy to help with review. |
Rationale
The row-group list path now validates its declared count before reserving capacity, but the schema conversion path still used
SchemaElement.num_childrenas aVeccapacity without checking it against the remaining flattened schema elements. A malformed Parquet footer could therefore request a very large allocation.Changes
SchemaElement.num_childrenagainst the remaining schema elements before allocating.i32::MAXchild count.Testing
cargo fmt --all -- --checkcargo test -p parquet schema::types::tests --libcargo test -p parquet file::metadata::thrift::tests::row_group_count_exceeding_remaining_input_is_rejected --libAddresses the remaining schema-path issue in #11954.
AI disclosure
Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.