[57_maintenance] Prevent Rows row index overflow (#9817)#9922
Merged
Conversation
- None. Rows used unchecked usize arithmetic when validating a requested row index. In optimized builds, very large indexes could wrap the bounds check before reaching the unchecked row access path. This adds checked arithmetic for row index validation and reuses it for both Rows::row and Rows::row_len. Yes. This adds regression coverage for overflowing row indexes. Invalid row indexes that overflow during bounds validation now panic consistently. There are no API changes.
10 tasks
alamb
commented
May 5, 2026
| .expect("row index out of bounds") | ||
| } | ||
|
|
||
| /// Returns the row at `index` without bounds checking |
Contributor
Author
There was a problem hiding this comment.
As the description points out the reason #9817 has more changes than this PR is:
Note: Rows::row_len and Rows::lengths are not present on the 57_maintenance line, so this backport applies the checked row index validation to Rows::row and includes the row_unchecked safety documentation update from the original PR.
This was introduced in
which was first released in 58.2.0
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.
57.3.1(May 2026) #9858This PR:
57_maintenancelineNote:
Rows::row_lenandRows::lengthsare not present on the57_maintenanceline, so this backport applies the checked row index validation toRows::rowand includes therow_uncheckedsafety documentation update from the original PR.