25208625 problem in UTILITY/ZIP s11u3-sru
authorLukas Rovensky <Lukas.Rovensky@oracle.com>
Thu, 12 Jan 2017 01:56:35 -0800
branchs11u3-sru
changeset 7595 a454f5e35b4c
parent 7594 022a611ded2d
child 7597 21897c6862f7
25208625 problem in UTILITY/ZIP
components/unzip/patches/07_CVE-2016-9844.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/unzip/patches/07_CVE-2016-9844.patch	Thu Jan 12 01:56:35 2017 -0800
@@ -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
[email protected]@ -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)