]> git.ipfire.org Git - thirdparty/zstd.git/commit
[huf] Fix OSS-Fuzz assert 2808/head
authorNick Terrell <terrelln@fb.com>
Mon, 27 Sep 2021 20:56:07 +0000 (13:56 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 27 Sep 2021 20:56:07 +0000 (13:56 -0700)
commita07ddb47f7d43529dde4922786516f7ec14754cb
treef55cac3a4d2b3883dab1b2c349b9e345dff32ec1
parent2ed14c2476a59a105a13fc05e6127122c07e6caa
[huf] Fix OSS-Fuzz assert

PR #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.
lib/decompress/huf_decompress.c