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

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