Repository navigation
fix(array-data): return an error on FixedSizeList validation overflow - #11859
Merged
Rich-T-kid merged 2 commits intoOct 26, 2026
Merged
Rich-T-kid merged 2 commits into
Rich-T-kid merged 2 commits into
Conversation
When checked_mul returns None, validation returns ArrowError::InvalidArgumentError. The message names the data type, the length-plus-offset value, and the list size, and states that the product exceeds usize. The added test uses an empty child with no null buffer, checks two length and offset pairs whose product overflows, and checks a fitting product that reports the child as shorter than required. Fixes apache#11851
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Validating a fixed-size list panics when length plus offset, multiplied by the list width, exceeds the largest address-sized integer. Array-data validation aborts the process. The expected child length is that product. checked_len_plus_offset already returns an error when the sum overflows. The following checked_mul(list_size) uses expect, so an overflowing product panics.
When checked_mul returns None, validation returns ArrowError::InvalidArgumentError. The message names the data type, the length-plus-offset value, and the list size, and states that the product exceeds usize. The added test uses an empty child with no null buffer, checks two length and offset pairs whose product overflows, and checks a fitting product that reports the child as shorter than required.
What changes are included in this PR?
Covered in the summary above.
Are these changes tested?
cargo test -q --manifest-path arrow-data/Cargo.toml -p arrow-data reported 86 passed and 0 failed.
The same cargo test command reported 13 passed and 0 failed in the following suite.
The same cargo test command ran the doctests.
Are there any significant user-facing changes?
Covered in the summary above.
AI was used for assistance.