From: Yann Collet Date: Fri, 23 Oct 2015 11:23:09 +0000 (+0100) Subject: fixed issue #49, reported by Hanno Böck (@hannob) X-Git-Tag: zstd-0.2.1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40603ffb240507c93ceeeb79106f6364a9691798;p=thirdparty%2Fzstd.git fixed issue #49, reported by Hanno Böck (@hannob) --- diff --git a/lib/huff0.c b/lib/huff0.c index 2200e5017..74c7a7be0 100644 --- a/lib/huff0.c +++ b/lib/huff0.c @@ -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;