Alexander Pyhalov
2017-01-16 71bad2741332b5e3b4240ca5e9d19400532f1a55
unzip: fix CVE-2016-9844
1 files deleted
1 files added
1 files modified
30 ■■■■■ changed files
components/archiver/unzip/Makefile 2 ●●● patch | view | raw | blame | history
components/archiver/unzip/patches/CVE-2016-9844.patch 26 ●●●●● patch | view | raw | blame | history
components/archiver/unzip/resolve.deps 2 ●●●●● patch | view | raw | blame | history
components/archiver/unzip/Makefile
@@ -26,7 +26,7 @@
COMPONENT_NAME=        unzip
COMPONENT_VERSION=    6.0
COMPONENT_REVISION=    3
COMPONENT_REVISION=    4
COMPONENT_SRC=        $(COMPONENT_NAME)60
COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tgz
COMPONENT_ARCHIVE_HASH=    \
components/archiver/unzip/patches/CVE-2016-9844.patch
New file
@@ -0,0 +1,26 @@
Patch based on http://seclists.org/oss-sec/2016/q4/600
The community plans to fix this security vulnerability in a future
release, so we will not pass this patch to the community.
--- unzip60/zipinfo.c    2017-01-12 01:09:21.487547363 -0800
+++ unzip60/zipinfo.c.new    2017-01-12 01:13:38.476562067 -0800
@@ -1987,7 +1987,18 @@
         ush  dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3);
         methbuf[3] = dtype[dnum];
     } else if (methnum >= NUM_METHODS) {   /* unknown */
-        sprintf(&methbuf[1], "%03u", G.crec.compression_method);
+        /* 2016-12-05 SMS.
+         * https://launchpad.net/bugs/1643750
+         * Unexpectedly large compression methods overflow
+         * &methbuf[].  Use the old, three-digit decimal format
+         * for values which fit.  Otherwise, sacrifice the "u",
+         * and use four-digit hexadecimal.
+         */
+         if (G.crec.compression_method <= 999) {
+            sprintf(&methbuf[1], "%03u", G.crec.compression_method);
+         } else {
+            sprintf(&methbuf[0], "%04X", G.crec.compression_method);
+         }
     }
     for (k = 0;  k < 15;  ++k)
components/archiver/unzip/resolve.deps
File was deleted