Repository navigation
Validate buffer sizes and preserve output layout in checksum decoders - #891
Open
justavibedev wants to merge 2 commits into
Open
justavibedev wants to merge 2 commits into
justavibedev wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #891 +/- ##
==========================================
+ Coverage 89.71% 89.79% +0.07%
==========================================
Files 27 27
Lines 914 921 +7
==========================================
+ Hits 820 827 +7
Misses 94 94
🚀 New features to boost your workflow:
|
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.
Fixes #890 and #894.
The first commit fixes input validation for CRC32, CRC32C and Adler32. CRC32 could decode an eight-byte buffer but rejected a view of those same bytes as two uint32s. It now checks the byte count on the contiguous view it uses to extract the checksum.
The second fixes the output buffer in JenkinsLookup3. Decoding a one-byte payload into a four-byte output could write the same byte four times and report success. It now checks the destination size before writing. The tests also cover correctly sized bytearrays, C- and Fortran-ordered matrices, and a strided output.
The checksum and Jenkins test modules passed locally (251 passed, one skipped). I used the upstream Python sources and the 0.17.1 wheel’s compiled extensions. I also checked exact payload bytes across 56 combinations of dtype, shape and memory order. Both release-note links rendered in the local docs build, which finished with warnings.
The earlier hosted run hit a separate package import failure with zfpy 1.0.1.post0 during test collection. #893 addresses that failure. Codex assisted with implementation and testing.