summarylogtreecommitdiffstats
path: root/unzip-6.0_CVE-2021-4217.patch
blob: 37b83cca0575007a1f7700fe9439c32d527c9c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/process.c b/process.c
index d2a846e..cba2463 100644
--- a/process.c
+++ b/process.c
@@ -2064,10 +2064,14 @@ int getUnicodeData(__G__ ef_buf, ef_len)
           G.unipath_checksum = makelong(offset + ef_buf);
           offset += 4;
 
+          if (!G.filename_full) {
+            /* Check if we have a unicode extra section but no filename set */
+            return PK_ERR;
+          }
+
           /*
            * Compute 32-bit crc
            */
-
           chksum = crc32(chksum, (uch *)(G.filename_full),
                          strlen(G.filename_full));