···11+From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=971984&action=diff&context=patch&collapsed=&headers=1&format=raw
22+33+--- unzip60/extract.c 2010-04-03 14:41:55 -0500
44++++ unzip60/extract.c 2014-12-03 15:33:35 -0600
55+@@ -1,5 +1,5 @@
66+ /*
77+- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
88++ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
99+1010+ See the accompanying file LICENSE, version 2009-Jan-02 or later
1111+ (the contents of which are also included in unzip.h) for terms of use.
1212+@@ -298,6 +298,8 @@
1313+ #ifndef SFX
1414+ static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
1515+ EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
1616++ static ZCONST char Far TooSmallEFlength[] = "bad extra-field entry:\n \
1717++ EF block length (%u bytes) invalid (< %d)\n";
1818+ static ZCONST char Far InvalidComprDataEAs[] =
1919+ " invalid compressed data for EAs\n";
2020+ # if (defined(WIN32) && defined(NTSD_EAS))
2121+@@ -2023,7 +2025,8 @@
2222+ ebID = makeword(ef);
2323+ ebLen = (unsigned)makeword(ef+EB_LEN);
2424+2525+- if (ebLen > (ef_len - EB_HEADSIZE)) {
2626++ if (ebLen > (ef_len - EB_HEADSIZE))
2727++ {
2828+ /* Discovered some extra field inconsistency! */
2929+ if (uO.qflag)
3030+ Info(slide, 1, ((char *)slide, "%-22s ",
3131+@@ -2032,6 +2035,16 @@
3232+ ebLen, (ef_len - EB_HEADSIZE)));
3333+ return PK_ERR;
3434+ }
3535++ else if (ebLen < EB_HEADSIZE)
3636++ {
3737++ /* Extra block length smaller than header length. */
3838++ if (uO.qflag)
3939++ Info(slide, 1, ((char *)slide, "%-22s ",
4040++ FnFilter1(G.filename)));
4141++ Info(slide, 1, ((char *)slide, LoadFarString(TooSmallEFlength),
4242++ ebLen, EB_HEADSIZE));
4343++ return PK_ERR;
4444++ }
4545+4646+ switch (ebID) {
4747+ case EF_OS2:
+26
pkgs/tools/archivers/unzip/CVE-2014-8140.diff
···11+From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=969621&action=diff
22+(unzip60/ path prefix added)
33+44+--- unzip60/extract.c 2009-03-14 02:32:52.000000000 +0100
55++++ unzip60/extract.c 2014-12-05 22:43:13.000000000 +0100
66+@@ -2221,10 +2234,17 @@ static int test_compr_eb(__G__ eb, eb_si
77+ if (compr_offset < 4) /* field is not compressed: */
88+ return PK_OK; /* do nothing and signal OK */
99+1010++ /* Return no/bad-data error status if any problem is found:
1111++ * 1. eb_size is too small to hold the uncompressed size
1212++ * (eb_ucsize). (Else extract eb_ucsize.)
1313++ * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS.
1414++ * 3. eb_ucsize is positive, but eb_size is too small to hold
1515++ * the compressed data header.
1616++ */
1717+ if ((eb_size < (EB_UCSIZE_P + 4)) ||
1818+- ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
1919+- eb_size <= (compr_offset + EB_CMPRHEADLEN)))
2020+- return IZ_EF_TRUNC; /* no compressed data! */
2121++ ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
2222++ ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
2323++ return IZ_EF_TRUNC; /* no/bad compressed data! */
2424+2525+ if (
2626+ #ifdef INT_16BIT
+136
pkgs/tools/archivers/unzip/CVE-2014-8141.diff
···11+From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=969625&action=diff
22+(unzip60/ path prefix added)
33+44+--- unzip60/process.c 2009-03-06 02:25:10.000000000 +0100
55++++ unzip60/process.c 2014-12-05 22:42:39.000000000 +0100
66+@@ -1,5 +1,5 @@
77+ /*
88+- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
99++ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
1010+1111+ See the accompanying file LICENSE, version 2009-Jan-02 or later
1212+ (the contents of which are also included in unzip.h) for terms of use.
1313+@@ -1888,48 +1888,82 @@ int getZip64Data(__G__ ef_buf, ef_len)
1414+ and a 4-byte version of disk start number.
1515+ Sets both local header and central header fields. Not terribly clever,
1616+ but it means that this procedure is only called in one place.
1717++
1818++ 2014-12-05 SMS.
1919++ Added checks to ensure that enough data are available before calling
2020++ makeint64() or makelong(). Replaced various sizeof() values with
2121++ simple ("4" or "8") constants. (The Zip64 structures do not depend
2222++ on our variable sizes.) Error handling is crude, but we should now
2323++ stay within the buffer.
2424+ ---------------------------------------------------------------------------*/
2525+2626++#define Z64FLGS 0xffff
2727++#define Z64FLGL 0xffffffff
2828++
2929+ if (ef_len == 0 || ef_buf == NULL)
3030+ return PK_COOL;
3131+3232+ Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n",
3333+ ef_len));
3434+3535+- while (ef_len >= EB_HEADSIZE) {
3636++ while (ef_len >= EB_HEADSIZE)
3737++ {
3838+ eb_id = makeword(EB_ID + ef_buf);
3939+ eb_len = makeword(EB_LEN + ef_buf);
4040+4141+- if (eb_len > (ef_len - EB_HEADSIZE)) {
4242+- /* discovered some extra field inconsistency! */
4343++ if (eb_len > (ef_len - EB_HEADSIZE))
4444++ {
4545++ /* Extra block length exceeds remaining extra field length. */
4646+ Trace((stderr,
4747+ "getZip64Data: block length %u > rest ef_size %u\n", eb_len,
4848+ ef_len - EB_HEADSIZE));
4949+ break;
5050+ }
5151+- if (eb_id == EF_PKSZ64) {
5252+-
5353++ if (eb_id == EF_PKSZ64)
5454++ {
5555+ int offset = EB_HEADSIZE;
5656+5757+- if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){
5858+- G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf);
5959+- offset += sizeof(G.crec.ucsize);
6060++ if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL))
6161++ {
6262++ if (offset+ 8 > ef_len)
6363++ return PK_ERR;
6464++
6565++ G.crec.ucsize = G.lrec.ucsize = makeint64(offset + ef_buf);
6666++ offset += 8;
6767+ }
6868+- if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){
6969+- G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf);
7070+- offset += sizeof(G.crec.csize);
7171++
7272++ if ((G.crec.csize == Z64FLGL) || (G.lrec.csize == Z64FLGL))
7373++ {
7474++ if (offset+ 8 > ef_len)
7575++ return PK_ERR;
7676++
7777++ G.csize = G.crec.csize = G.lrec.csize = makeint64(offset + ef_buf);
7878++ offset += 8;
7979+ }
8080+- if (G.crec.relative_offset_local_header == 0xffffffff){
8181++
8282++ if (G.crec.relative_offset_local_header == Z64FLGL)
8383++ {
8484++ if (offset+ 8 > ef_len)
8585++ return PK_ERR;
8686++
8787+ G.crec.relative_offset_local_header = makeint64(offset + ef_buf);
8888+- offset += sizeof(G.crec.relative_offset_local_header);
8989++ offset += 8;
9090+ }
9191+- if (G.crec.disk_number_start == 0xffff){
9292++
9393++ if (G.crec.disk_number_start == Z64FLGS)
9494++ {
9595++ if (offset+ 4 > ef_len)
9696++ return PK_ERR;
9797++
9898+ G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf);
9999+- offset += sizeof(G.crec.disk_number_start);
100100++ offset += 4;
101101+ }
102102++#if 0
103103++ break; /* Expect only one EF_PKSZ64 block. */
104104++#endif /* 0 */
105105+ }
106106+107107+- /* Skip this extra field block */
108108++ /* Skip this extra field block. */
109109+ ef_buf += (eb_len + EB_HEADSIZE);
110110+ ef_len -= (eb_len + EB_HEADSIZE);
111111+ }
112112+--- unzip60/fileio.c 2009-04-20 02:03:44.000000000 +0200
113113++++ unzip60/fileio.c 2014-12-05 22:44:16.000000000 +0100
114114+@@ -176,6 +176,8 @@ static ZCONST char Far FilenameTooLongTr
115115+ #endif
116116+ static ZCONST char Far ExtraFieldTooLong[] =
117117+ "warning: extra field too long (%d). Ignoring...\n";
118118++static ZCONST char Far ExtraFieldCorrupt[] =
119119++ "warning: extra field (type: 0x%04x) corrupt. Continuing...\n";
120120+121121+ #ifdef WINDLL
122122+ static ZCONST char Far DiskFullQuery[] =
123123+@@ -2295,7 +2297,12 @@ int do_string(__G__ length, option) /*
124124+ if (readbuf(__G__ (char *)G.extra_field, length) == 0)
125125+ return PK_EOF;
126126+ /* Looks like here is where extra fields are read */
127127+- getZip64Data(__G__ G.extra_field, length);
128128++ if (getZip64Data(__G__ G.extra_field, length) != PK_COOL)
129129++ {
130130++ Info(slide, 0x401, ((char *)slide,
131131++ LoadFarString( ExtraFieldCorrupt), EF_PKSZ64));
132132++ error = PK_WARN;
133133++ }
134134+ #ifdef UNICODE_SUPPORT
135135+ G.unipath_filename = NULL;
136136+ if (G.UzO.U_flag < 2) {