From: Vivek Miglani Date: Mon, 15 Jul 2019 19:10:21 +0000 (-0700) Subject: Return error if block size exceeds maximum X-Git-Tag: v1.4.2^2~9^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f108f82fbcc87226a01b48e04a29d50dd96dce0;p=thirdparty%2Fzstd.git Return error if block size exceeds maximum --- diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c index e42872ad9..5eda3cb60 100644 --- a/lib/decompress/zstd_decompress.c +++ b/lib/decompress/zstd_decompress.c @@ -909,6 +909,7 @@ size_t ZSTD_decompressContinue(ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, c { blockProperties_t bp; size_t const cBlockSize = ZSTD_getcBlockSize(src, ZSTD_blockHeaderSize, &bp); if (ZSTD_isError(cBlockSize)) return cBlockSize; + RETURN_ERROR_IF(cBlockSize > ZSTD_BLOCKSIZE_MAX, corruption_detected, "Block Size Exceeds Maximum"); dctx->expected = cBlockSize; dctx->bType = bp.blockType; dctx->rleSize = bp.origSize;