Skip to content
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

[fuzzer] Add Huffman decompression fuzzer #2784

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

terrelln
Copy link
Contributor

Add a fuzzer for Huffman decompression. Fix several bugs in Huffman
decompression, mostly related to op == NULL and pointer underflow.

Note: Review only the 2nd commit. The first is from PR #2783, and will disappear after it is merged.

@Cyan4973
Copy link
Contributor

For some reason, github doesn't let us select only the 2nd commit to see

@terrelln
Copy link
Contributor Author

Strange... Well once I figure out this compiler error, I'll merge the first PR.

Add a fuzzer for Huffman decompression. Fix several bugs in Huffman
decompression, mostly related to `op == NULL` and pointer underflow.
@terrelln terrelln merged commit 51b123d into facebook:dev Sep 20, 2021
terrelln added a commit to terrelln/zstd that referenced this pull request Sep 27, 2021
PR facebook#2784 introduced a bug in the decompressor that caused some valid
inputs to fail to decompress. The bitstream isn't reloaded after the 4X*
loop if the number of elements remaining is small enough, causing us to
read more bits than are available in the bitcontainer.

This was caught by the MSAN fuzzer in OSS-Fuzz because the assembly
implementation isn't used in the MSAN build.

Credit to OSS-Fuzz.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants