gnu: gd: Fix-CVE-2016-3074.
[jackhill/guix/guix.git] / gnu / packages / patches / unzip-CVE-2014-8140.patch
1 From: sms
2 Subject: Fix CVE-2014-8140: out-of-bounds write issue in test_compr_eb()
3 Bug-Debian: http://bugs.debian.org/773722
4
5 --- a/extract.c
6 +++ b/extract.c
7 @@ -2234,10 +2234,17 @@
8 if (compr_offset < 4) /* field is not compressed: */
9 return PK_OK; /* do nothing and signal OK */
10
11 + /* Return no/bad-data error status if any problem is found:
12 + * 1. eb_size is too small to hold the uncompressed size
13 + * (eb_ucsize). (Else extract eb_ucsize.)
14 + * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS.
15 + * 3. eb_ucsize is positive, but eb_size is too small to hold
16 + * the compressed data header.
17 + */
18 if ((eb_size < (EB_UCSIZE_P + 4)) ||
19 - ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
20 - eb_size <= (compr_offset + EB_CMPRHEADLEN)))
21 - return IZ_EF_TRUNC; /* no compressed data! */
22 + ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
23 + ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
24 + return IZ_EF_TRUNC; /* no/bad compressed data! */
25
26 if (
27 #ifdef INT_16BIT