From 18442a31ff4b87263a6138369e8d0880346af0bd Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Tue, 19 Sep 2017 13:46:07 -0700 Subject: [PATCH] [libzstd] Fix bad window size assert The window size is not validated or used in the one-pass API, so there shouldn't be an assert based on it. fix-fuzz-failure --- lib/decompress/zstd_decompress.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index 6d6d83396..91518990e 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -1372,8 +1372,9 @@ static size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, * conservative. */ ZSTD_longOffset_e const isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (!frame || dctx->fParams.windowSize > (1ULL << STREAM_ACCUMULATOR_MIN))); - /* We don't expect window sizes this big. */ - assert(!frame || dctx->fParams.windowSize <= (1ULL << STREAM_ACCUMULATOR_MIN_64)); + /* windowSize could be any value at this point, since it is only validated + * in the streaming API. + */ DEBUGLOG(5, "ZSTD_decompressBlock_internal"); if (srcSize >= ZSTD_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);