Skip to content

[56_maintenance] Prevent ArrayData validation length overflow (#9816)#9914

Merged
alamb merged 1 commit into
apache:56_maintenancefrom
alamb:alamb/backport_9816
May 6, 2026
Merged

[56_maintenance] Prevent ArrayData validation length overflow (#9816)#9914
alamb merged 1 commit into
apache:56_maintenancefrom
alamb:alamb/backport_9816

Conversation

@alamb
Copy link
Copy Markdown
Contributor

@alamb alamb commented May 5, 2026

@github-actions github-actions Bot added the arrow Changes to the arrow crate label May 5, 2026
- None.

`ArrayData` validation used unchecked `usize` arithmetic when combining
array lengths and offsets. In optimized builds, very large lengths could
wrap these calculations and allow invalid `ArrayData` metadata to pass
validation.

This adds checked arithmetic for length plus offset calculations in
`ArrayData` validation, including offset-buffer validation and related
typed-buffer sizing paths.

Yes. This adds regression coverage for overflowing offset-buffer and
typed-buffer length calculations.

Validated with:

```bash
cargo test -p arrow-data overflow --release
```

Invalid `ArrayData` whose length and offset cannot be represented
without overflow now returns an validation error consistently across
build modes. There are no API changes.
@alamb alamb force-pushed the alamb/backport_9816 branch from bb2cba8 to 77434da Compare May 5, 2026 19:42
@alamb alamb marked this pull request as ready for review May 5, 2026 20:30
Copy link
Copy Markdown
Contributor

@etseidl etseidl left a comment

Choose a reason for hiding this comment

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

Looks correct

@alamb alamb merged commit c1e887c into apache:56_maintenance May 6, 2026
26 checks passed
@alamb alamb deleted the alamb/backport_9816 branch May 6, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants