zstd/lib/decompress
Nick Terrell 5717bd39ee [lib] Fix NULL pointer dereference
When the output buffer is `NULL` with size 0, but the frame content size
is non-zero, we will write to the NULL pointer because our bounds check
underflowed.

This was exposed by a recent PR that allowed an empty frame into the
single-pass shortcut in streaming mode.

* Fix the bug.
* Fix another NULL dereference in zstd-v1.
* Overflow checks in 32-bit mode.
* Add a dedicated test.
* Expose the bug in the dedicated simple_decompress fuzzer.
* Switch all mallocs in fuzzers to return NULL for size=0.
* Fix a new timeout in a fuzzer.

Neither clang nor gcc show a decompression speed regression on x86-64.
On x86-32 clang is slightly positive and gcc loses 2.5% of speed.

Credit to OSS-Fuzz.
2020-05-06 12:09:02 -07:00
..
huf_decompress.c Rewrite Include Paths to be Relative 2020-05-04 15:20:26 -04:00
zstd_ddict.c Rewrite Include Paths to be Relative 2020-05-04 15:20:26 -04:00
zstd_ddict.h Rewrite Include Paths to be Relative 2020-05-04 15:20:26 -04:00
zstd_decompress_block.c [lib] Fix NULL pointer dereference 2020-05-06 12:09:02 -07:00
zstd_decompress_block.h Rewrite Include Paths to be Relative 2020-05-04 15:20:26 -04:00
zstd_decompress_internal.h Rewrite Include Paths to be Relative 2020-05-04 15:20:26 -04:00
zstd_decompress.c Rewrite Include Paths to be Relative 2020-05-04 15:20:26 -04:00