Repository navigation
Fix bounds checks in binary reads, page traversal, and LOB loading - #6
Merged
Merged
Conversation
Reject truncated fields and offsets outside the supplied buffer before accessing bytes. Use subtraction for the size check to avoid overflow. Add regression tests for short buffers, boundary offsets, and valid values.
Require a complete page and reject slot counts that would wrap the slot index. Check row extents without adding untrusted lengths. Cover invalid page sizes and slot counts, valid rows and continuation links, and the existing behavior of skipping malformed row extents.
Reject inline values shorter than their declared length. Check chained LOB chunk indices and page sizes, and reject lengths beyond database capacity. Calculate page counts without overflowing the length. Add regression tests for truncated values, invalid bounds, and valid inline and chained contents.
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.
This adds missing bounds checks to binary field reads, page traversal, and LOB loading. The affected invalid inputs are rejected instead of allowing out-of-bounds access or silently returning truncated values.
Existing behavior for valid data and skipping malformed row extents is preserved. Self-contained native regression tests use the existing CMake/CTest setup. No CI changes or new dependencies are included.
I haven't run the full Windows suite.