Blame SOURCES/0004-Fix-buffer-overrun-when-generating-Huffman-codes.patch

c7acb0
From 42a8b8af21af24bb35548bcd2499c792d1a8c1a3 Mon Sep 17 00:00:00 2001
c7acb0
From: Richard Hughes <richard@hughsie.com>
c7acb0
Date: Wed, 1 Mar 2017 17:15:10 +0000
c7acb0
Subject: [PATCH 4/4] Fix buffer overrun when generating Huffman codes
c7acb0
c7acb0
---
c7acb0
 libgcab/decomp.c | 4 +++-
c7acb0
 1 file changed, 3 insertions(+), 1 deletion(-)
c7acb0
c7acb0
diff --git a/libgcab/decomp.c b/libgcab/decomp.c
c7acb0
index 52445e8..3ee8f9b 100644
c7acb0
--- a/libgcab/decomp.c
c7acb0
+++ b/libgcab/decomp.c
c7acb0
@@ -190,7 +190,9 @@ struct Ziphuft **t, cab_LONG *m, fdi_decomp_state *decomp_state)
c7acb0
           xp = ZIP(c) + k;
c7acb0
           while (++j < z)       /* try smaller tables up to z bits */
c7acb0
           {
c7acb0
-            if ((f <<= 1) <= *++xp)
c7acb0
+            if (*++xp > ZIPBMAX)
c7acb0
+              return 2;         /* corrupt */
c7acb0
+            if ((f <<= 1) <= *xp)
c7acb0
               break;            /* enough codes to use up j bits */
c7acb0
             f -= *xp;           /* else deduct codes from patterns */
c7acb0
           }
c7acb0
-- 
c7acb0
2.9.3
c7acb0