fixed OSSfuzz 11849

The problem was already masked,
due to no longer accepting tiny blocks for statistics.

But in case it could still happen with not-so-tiny blocks,
there is a stricter control which ensures that
nothing was already loaded prior to statistics collection.
This commit is contained in:
Yann Collet
2018-12-19 16:54:15 -08:00
parent 78c4ea4930
commit 2898afab52
3 changed files with 44 additions and 5 deletions
+1 -1
View File
@@ -3882,7 +3882,7 @@ size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs,
/* shortcut to compression pass directly into output buffer */
size_t const cSize = ZSTD_compressEnd(zcs,
op, oend-op, ip, iend-ip);
DEBUGLOG(4, "ZSTD_compressEnd : %u", (U32)cSize);
DEBUGLOG(4, "ZSTD_compressEnd : cSize=%u", (U32)cSize);
if (ZSTD_isError(cSize)) return cSize;
ip = iend;
op += cSize;