]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed issue #49, reported by Hanno Böck (@hannob)
authorYann Collet <yann.collet.73@gmail.com>
Fri, 23 Oct 2015 11:23:09 +0000 (12:23 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Fri, 23 Oct 2015 11:23:09 +0000 (12:23 +0100)
lib/huff0.c

index 2200e50178b13f8d22f54f3d5da9e9b7fe0416ec..74c7a7be0dec86bb1d62ad7e4b7b0e92256a6b80 100644 (file)
@@ -602,6 +602,7 @@ static size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, U32* rankStats,
 
     /* get last non-null symbol weight (implied, total must be 2^n) */
     tableLog = BIT_highbit32(weightTotal) + 1;
+    if (tableLog > HUF_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
     {
         U32 total = 1 << tableLog;
         U32 rest = total - weightTotal;