]> git.ipfire.org Git - thirdparty/zstd.git/commit
fix ZSTD_compressBlock() associated with CDict 1122/head
authorYann Collet <cyan@fb.com>
Mon, 7 May 2018 19:54:13 +0000 (12:54 -0700)
committerYann Collet <cyan@fb.com>
Mon, 7 May 2018 19:54:13 +0000 (12:54 -0700)
commitad4524d60526932445dd7ed7bcac35c298874e01
tree2f7d5b225a7d3cf316bc171bf9cba853d95114cc
parentef1abd3c071ce42a457404ee2bca6d5bebb87f62
fix ZSTD_compressBlock() associated with CDict

reported by @let-def.

It's actually a bug in ZSTD_compressBegin_usingCDict()
which would pass a wrong pledgedSrcSize value (0 instead of ZSTD_CONTENTSIZE_UNKNOWN)
resulting in wrong window size, resulting in downsized seqStore,
resulting in segfault when writing into the seqStore later in the process.

Added a test in fuzzer to cover this use case (fails before the patch).
lib/compress/zstd_compress.c
lib/compress/zstd_double_fast.c
tests/fuzzer.c