2
0
mirror of https://codeberg.org/kiss-community/repo synced 2025-03-30 09:42:47 -06:00
repo/extra/unzip/patches/unzip-6.0_CVE-2021-4217.patch
2022-09-18 13:04:10 +05:30

20 lines
581 B
Diff

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));