]> git.ipfire.org Git - thirdparty/zstd.git/commit
[legacy] Fix bug in zstd-0.5 decoder 1696/head
authorNick Terrell <terrelln@fb.com>
Mon, 22 Jul 2019 20:05:09 +0000 (13:05 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 22 Jul 2019 20:05:09 +0000 (13:05 -0700)
commite6edcfa79562b1f876d40ed108f5f9dd8ff6e220
tree6fff5cbc715e5e98ba5c12f295a599cd2d0c4c41
parentbe3d2e2de83bb56576d45e10e7f6fb105af28e55
[legacy] Fix bug in zstd-0.5 decoder

The match length and literal length extra bytes could either
by 2 bytes or 3 bytes in version 0.5. All earlier verions were
always 3 bytes, and later version didn't have dumps.

The bug, introduced by commit 0fd322f812211e653a83492c0c114b933f8b6bc5,
was triggered when the last dump was a 2-byte dump, because we didn't
separate that case from a 3-byte dump, and thought we were over-reading.

I've tested this fix with every zstd version < 1.0.0 on the buggy file,
and we are now always successfully decompressing with the right
checksum.

Fixes #1693.
lib/legacy/zstd_v05.c