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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for the legacy compressions (shrink/reduce/implode). #120
base: master
Are you sure you want to change the base?
Added support for the legacy compressions (shrink/reduce/implode). #120
Changes from 27 commits
b368df4
7568f40
77e247d
ad8efb6
334b110
bb8d030
905eeea
45d79f6
db40e5b
4189412
fafdaf1
45f0f66
68f3142
d8067eb
d1b7efd
6f57340
cdc08b9
9f96b07
45e8116
2010645
a403adc
c27ce16
9f88d25
ab2a55e
c3f3067
282b551
9fb99ad
33975b4
561c80f
7d99b89
52263ba
2a3af2e
d6783ad
f6c648b
cbda192
c36d480
585cc65
d5032a0
f69d2ae
91b9e16
232fbb2
b5ea557
b86fd93
3698198
9d60e97
1936dd6
3c60457
415d7de
2dbfc99
9aa2f1e
5d3654e
4377176
885d17c
fb948ee
a2f73e8
9703a77
c986a73
06b4a4b
e36f600
ab2a9b1
a01bb22
b4fd8d6
dcb4c98
d5e44bb
a4428cd
abbb5ec
e581456
c323dc9
4839a42
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any caller, outside of tests, that can ever pass in
lengths
the includes zeroes? Also, doesn
always equallengths.len()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be more efficient for
count[n]
to be the number ofn+1
-length codewords?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least then I can avoid making a documentation why the length is MAX_HUFFMAN_BITS + 1 :).
Check failure on line 69 in src/legacy/huffman.rs
GitHub Actions / style_and_docs
Check failure on line 79 in src/legacy/huffman.rs
GitHub Actions / style_and_docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this ever actually wrap if we're doing our jobs properly? If not, use
-
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know for sure it looked dangerous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least there are tests that fail if I use '-'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then please determine whether it's the tests or the code under test that has a bug, and document the answer in a comment.
Check failure on line 88 in src/legacy/huffman.rs
GitHub Actions / style_and_docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document in a comment why larger values of
l
are being skipped, even if only invalid ZIP files can render this condition false. If they can't, and theif
is just defensive programming, then delete it -- otherwise, it could mask bugs thatfuzz_read
would otherwise be able to catch (which, given the use of branch coverage as a fitness function in https://llvm.org/docs/LibFuzzer.html, is a much more realistic hope than if we were fuzzing uniformly-distributed random strings).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming
0b111_111
is an invalid input, add a test that it cause shuffman_decode
to returnErr
rather than giving false output or panicking. This crate is designed to be safe to use even on invalid and maliciously-crafted ZIP files, and to prevent panics, as long as methods such asZipArchive::decompressed_size
are used to enforce reasonable limits.