Skip to content

[56_maintenance] Prevent repeat slice length overflow (#9819)#9912

Closed
alamb wants to merge 1 commit intoapache:56_maintenancefrom
alamb:alamb/backport_9819
Closed

[56_maintenance] Prevent repeat slice length overflow (#9819)#9912
alamb wants to merge 1 commit intoapache:56_maintenancefrom
alamb:alamb/backport_9819

Conversation

@alamb
Copy link
Copy Markdown
Contributor

@alamb alamb commented May 5, 2026

- None.

MutableBuffer repeated slices used unchecked usize arithmetic when
calculating the number of bytes to reserve. In optimized builds, very
large repeat counts could wrap the capacity calculation before copying
repeated bytes.

This adds checked arithmetic for repeated slice byte length validation
before reserving capacity and copying repeated data.

Yes. This adds regression coverage for overflowing repeated slice length
calculations.

Invalid repeat counts whose requested byte 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
Copy link
Copy Markdown
Contributor Author

alamb commented May 5, 2026

This is a bot generated PR -- the function doesn't exist on this branch -- closing

@alamb alamb closed this May 5, 2026
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.

1 participant