Skip to content

fix(array-data): return an error on FixedSizeList validation overflow - #11859

Merged
Rich-T-kid merged 2 commits into
apache:mainfrom
mvanhorn:fix/11851-fixed-size-list-validation-overflow
Oct 26, 2026
Merged

Rich-T-kid merged 2 commits into
apache:mainfrom
mvanhorn:fix/11851-fixed-size-list-validation-overflow

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

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.

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
@github-actions github-actions Bot added arrow-core Core crates related to representing arrow data bug Squash those bugs labels Oct 23, 2026
@Rich-T-kid Rich-T-kid changed the title return an error on FixedSizeList validation overflow fix(array-data): return an error on FixedSizeList validation overflow Oct 23, 2026

@Rich-T-kid Rich-T-kid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @mvanhorn

@alamb alamb added the Prolific Author author opened PRs or issues in more than 20 repositories in the last 30 days label Oct 23, 2026
@Rich-T-kid
Rich-T-kid added this pull request to the merge queue Oct 26, 2026
Merged via the queue into apache:main with commit 8953c90 Oct 26, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data bug Squash those bugs Prolific Author author opened PRs or issues in more than 20 repositories in the last 30 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arraydata validation for fixedsizelist shouldn't panic on overflow

3 participants