]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix a constraint stricter than the spec 1663/head
authorEphraim Park <ephiepark@fb.com>
Wed, 26 Jun 2019 23:43:37 +0000 (16:43 -0700)
committerEphraim Park <ephiepark@fb.com>
Wed, 26 Jun 2019 23:43:37 +0000 (16:43 -0700)
lib/decompress/zstd_decompress_block.c

index 7707c28bb081f533f79bc66a93ba323b67e7c87e..741784fdf9fdae7e2e3bca4414b19ba702073117 100644 (file)
@@ -505,7 +505,7 @@ size_t ZSTD_decodeSeqHeaders(ZSTD_DCtx* dctx, int* nbSeqPtr,
     *nbSeqPtr = nbSeq;
 
     /* FSE table descriptors */
-    RETURN_ERROR_IF(ip+4 > iend, srcSize_wrong); /* minimum possible size */
+    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong); /* minimum possible size: 1 byte for symbol encoding types */
     {   symbolEncodingType_e const LLtype = (symbolEncodingType_e)(*ip >> 6);
         symbolEncodingType_e const OFtype = (symbolEncodingType_e)((*ip >> 4) & 3);
         symbolEncodingType_e const MLtype = (symbolEncodingType_e)((*ip >> 2) & 3);