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

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