gendx / lzma-rs

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

Behavior mismatches between liblzma and lzma-rs #35

Open Shnatsel opened 4 years ago

Shnatsel commented 4 years ago

The attached files behave differently when decompressed with lzma-rs and with xz2 crate backed by lzma-sys: lzmars_xz2_mismatches.tar.gz

These files are generated by a fuzzer and do not have valid checksums in them. Checksum verification needs to be disabled in both implementations to reproduce the issue.

Found via #34

Shnatsel commented 4 years ago

More specifically, this xz file decodes fine via the reference implementation but fails to decode with lzma-rs: reference_succeeded_lzmars_failed.xz.gz (gzipped so that github would accept the upload)

I've built a quick'n'dirty fuzz harness for the lzma level, bypassing xz, and it seems there are mismatches there as well.

However, a superficial test on xz files did not find any cases when both decoders succeed, but produce different outputs.