gendx / lzma-rs

An LZMA decoder written in pure Rust
MIT License
128 stars 27 forks source link

Fix Streaming Partial EOF Bug #65

Closed cccs-sadugas closed 3 years ago

cccs-sadugas commented 3 years ago

Pull Request Overview

This pull request fixes the bug in the streaming decompressor that produces shorter output than expected for some chunk sizes.

It also adds a streaming fuzz target.

Testing Strategy

@gendx already introduced a test case for various chunk sizes which allowed us to find this bug. The fuzzing target will also help.

Supporting Documentation and References

Related to https://github.com/gendx/lzma-rs/pull/63

gendx commented 3 years ago

If you can add the reduced test case that you found with fuzzing that would also be nice to have as an additional regression test.

cccs-sadugas commented 3 years ago

Superseded by #67

cccs-sadugas commented 3 years ago

If you can add the reduced test case that you found with fuzzing that would also be nice to have as an additional regression test.

This PR is destined to merge into master, however that test would need #63 . How should I proceed?

I created a new branch with the regression test that bases the commits on top of the 0.2.0 PR. It can be seen here. However, the test does not fail so I can't yet reproduce the fuzzer crash outside of cargo fuzz.

gendx commented 3 years ago

Ok, let me merge #67 first. I'll then update #63 again and hopefully merge it. We can add the reduced test case afterwards.