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

[huf] Fix bug in fast C decoders #3459

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

terrelln
Copy link
Contributor

@terrelln terrelln commented Jan 26, 2023

The input bounds checks were buggy because they were only breaking from the inner loop, not the outer loop. The fuzzers found this immediately. The fix is to use goto _out instead of break.

This condition can happen on corrupted inputs.

I've benchmarked before and after on x86-64 and there were small changes in performance, some positive, and some negative, and they end up about balacing out.

Credit to OSS-Fuzz

The input bounds checks were buggy because they were only breaking from
the inner loop, not the outer loop. The fuzzers found this immediately.
The fix is to use `goto _out` instead of `break`.

This condition can happen on corrupted inputs.

I've benchmarked before and after on x86-64 and there were small changes
in performance, some positive, and some negative, and they end up about
balacing out.

Credit to  OSS-Fuzz
@terrelln terrelln merged commit bda947e into facebook:dev Jan 26, 2023
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