From fc60883d42f7f860d4573e34b466eca632d57966 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 23 Oct 2015 12:45:02 +0100 Subject: [PATCH] =?UTF-8?q?fixed=20issue=20#49,=20reported=20by=20Hanno=20?= =?UTF-8?q?B=C3=B6ck=20(@hannob)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/huff0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/huff0.c b/lib/huff0.c index 2200e501..74c7a7be 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;