···1+From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=971984&action=diff&context=patch&collapsed=&headers=1&format=raw
2+3+--- unzip60/extract.c 2010-04-03 14:41:55 -0500
4++++ unzip60/extract.c 2014-12-03 15:33:35 -0600
5+@@ -1,5 +1,5 @@
6+ /*
7+- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
8++ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
9+10+ See the accompanying file LICENSE, version 2009-Jan-02 or later
11+ (the contents of which are also included in unzip.h) for terms of use.
12+@@ -298,6 +298,8 @@
13+ #ifndef SFX
14+ static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
15+ EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
16++ static ZCONST char Far TooSmallEFlength[] = "bad extra-field entry:\n \
17++ EF block length (%u bytes) invalid (< %d)\n";
18+ static ZCONST char Far InvalidComprDataEAs[] =
19+ " invalid compressed data for EAs\n";
20+ # if (defined(WIN32) && defined(NTSD_EAS))
21+@@ -2023,7 +2025,8 @@
22+ ebID = makeword(ef);
23+ ebLen = (unsigned)makeword(ef+EB_LEN);
24+25+- if (ebLen > (ef_len - EB_HEADSIZE)) {
26++ if (ebLen > (ef_len - EB_HEADSIZE))
27++ {
28+ /* Discovered some extra field inconsistency! */
29+ if (uO.qflag)
30+ Info(slide, 1, ((char *)slide, "%-22s ",
31+@@ -2032,6 +2035,16 @@
32+ ebLen, (ef_len - EB_HEADSIZE)));
33+ return PK_ERR;
34+ }
35++ else if (ebLen < EB_HEADSIZE)
36++ {
37++ /* Extra block length smaller than header length. */
38++ if (uO.qflag)
39++ Info(slide, 1, ((char *)slide, "%-22s ",
40++ FnFilter1(G.filename)));
41++ Info(slide, 1, ((char *)slide, LoadFarString(TooSmallEFlength),
42++ ebLen, EB_HEADSIZE));
43++ return PK_ERR;
44++ }
45+46+ switch (ebID) {
47+ case EF_OS2:
+26
pkgs/tools/archivers/unzip/CVE-2014-8140.diff
···00000000000000000000000000
···1+From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=969621&action=diff
2+(unzip60/ path prefix added)
3+4+--- unzip60/extract.c 2009-03-14 02:32:52.000000000 +0100
5++++ unzip60/extract.c 2014-12-05 22:43:13.000000000 +0100
6+@@ -2221,10 +2234,17 @@ static int test_compr_eb(__G__ eb, eb_si
7+ if (compr_offset < 4) /* field is not compressed: */
8+ return PK_OK; /* do nothing and signal OK */
9+10++ /* Return no/bad-data error status if any problem is found:
11++ * 1. eb_size is too small to hold the uncompressed size
12++ * (eb_ucsize). (Else extract eb_ucsize.)
13++ * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS.
14++ * 3. eb_ucsize is positive, but eb_size is too small to hold
15++ * the compressed data header.
16++ */
17+ if ((eb_size < (EB_UCSIZE_P + 4)) ||
18+- ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
19+- eb_size <= (compr_offset + EB_CMPRHEADLEN)))
20+- return IZ_EF_TRUNC; /* no compressed data! */
21++ ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
22++ ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
23++ return IZ_EF_TRUNC; /* no/bad compressed data! */
24+25+ if (
26+ #ifdef INT_16BIT