Skip to content

[57_maintenance] Prevent BitChunks length overflow (#9818)#9918

Merged
alamb merged 1 commit into
apache:57_maintenancefrom
alamb:alamb/backport_9818_57
May 6, 2026
Merged

[57_maintenance] Prevent BitChunks length overflow (#9818)#9918
alamb merged 1 commit into
apache:57_maintenancefrom
alamb:alamb/backport_9818_57

Conversation

@alamb

@alamb alamb commented May 5, 2026

Copy link
Copy Markdown
Contributor

# Which issue does this PR close?

- None.

# Rationale for this change

BitChunks used unchecked usize arithmetic when validating bit offset
plus length. In optimized builds, very large lengths could wrap this
bounds check before constructing the iterator state.

# What changes are included in this PR?

This adds checked arithmetic for BitChunks bounds validation

# Are these changes tested?

Yes. This adds regression coverage for overflowing bit offset plus
length validation.

# Are there any user-facing changes?

Invalid BitChunks inputs whose offset and length cannot be represented
without overflow now panic consistently. There are no API changes.
@github-actions github-actions Bot added the arrow Changes to the arrow crate label May 5, 2026
@alamb alamb marked this pull request as ready for review May 5, 2026 20:31

@etseidl etseidl 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.

👍

@alamb alamb merged commit abd6d4d into apache:57_maintenance May 6, 2026
26 checks passed
@alamb alamb deleted the alamb/backport_9818_57 branch May 6, 2026 13:02
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