1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/unzip/CVE-2014-8140.patch
3 # Copyright (C) 2021 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=969621&action=diff
15 (unzip60/ path prefix added)
17 --- unzip60/extract.c 2009-03-14 02:32:52.000000000 +0100
18 +++ unzip60/extract.c 2014-12-05 22:43:13.000000000 +0100
19 @@ -2221,10 +2234,17 @@ static int test_compr_eb(__G__ eb, eb_si
20 if (compr_offset < 4) /* field is not compressed: */
21 return PK_OK; /* do nothing and signal OK */
23 + /* Return no/bad-data error status if any problem is found:
24 + * 1. eb_size is too small to hold the uncompressed size
25 + * (eb_ucsize). (Else extract eb_ucsize.)
26 + * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS.
27 + * 3. eb_ucsize is positive, but eb_size is too small to hold
28 + * the compressed data header.
30 if ((eb_size < (EB_UCSIZE_P + 4)) ||
31 - ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
32 - eb_size <= (compr_offset + EB_CMPRHEADLEN)))
33 - return IZ_EF_TRUNC; /* no compressed data! */
34 + ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
35 + ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
36 + return IZ_EF_TRUNC; /* no/bad compressed data! */