Blame SOURCES/0003-Fix-a-theoretical-crash-when-building-the-table-entr.patch

c7acb0
From 42c5e4f6d227b0dcee7e01702e9338f15dfa1568 Mon Sep 17 00:00:00 2001
c7acb0
From: Richard Hughes <richard@hughsie.com>
c7acb0
Date: Wed, 1 Mar 2017 17:02:05 +0000
c7acb0
Subject: [PATCH 3/4] Fix a theoretical crash when building the table entries
c7acb0
c7acb0
I can't actually see a way to construct the ZIPstate with no tables, but this
c7acb0
at least this stops Coverity complaining.
c7acb0
---
c7acb0
 libgcab/decomp.c | 4 ++++
c7acb0
 1 file changed, 4 insertions(+)
c7acb0
c7acb0
diff --git a/libgcab/decomp.c b/libgcab/decomp.c
c7acb0
index cce368e..52445e8 100644
c7acb0
--- a/libgcab/decomp.c
c7acb0
+++ b/libgcab/decomp.c
c7acb0
@@ -248,6 +248,10 @@ struct Ziphuft **t, cab_LONG *m, fdi_decomp_state *decomp_state)
c7acb0
         i ^= j;
c7acb0
       i ^= j;
c7acb0
 
c7acb0
+      /* no tables */
c7acb0
+      if (h < 0)
c7acb0
+        return 2;               /* corrupt */
c7acb0
+
c7acb0
       /* backup over finished tables */
c7acb0
       while ((i & ((1 << w) - 1)) != ZIP(x)[h])
c7acb0
         w -= l[--h];            /* don't need to update q */
c7acb0
-- 
c7acb0
2.9.3
c7acb0