components/unzip/patches/CVE-2014-8140.patch
branchs11-update
changeset 3678 96c88473320c
equal deleted inserted replaced
3677:e1672cb10a1e 3678:96c88473320c
       
     1 Source:
       
     2 https://bugzilla.redhat.com/show_bug.cgi?id=1174851
       
     3 Info:
       
     4 http://www.ocert.org/advisories/ocert-2014-011.html
       
     5 
       
     6 --- a/extract.c	2009-03-14 02:32:52.000000000 +0100
       
     7 +++ b/extract.c	2014-12-05 22:43:13.000000000 +0100
       
     8 @@ -2221,10 +2234,17 @@ static int test_compr_eb(__G__ eb, eb_si
       
     9      if (compr_offset < 4)                /* field is not compressed: */
       
    10          return PK_OK;                    /* do nothing and signal OK */
       
    11  
       
    12 +    /* Return no/bad-data error status if any problem is found:
       
    13 +     *    1. eb_size is too small to hold the uncompressed size
       
    14 +     *       (eb_ucsize).  (Else extract eb_ucsize.)
       
    15 +     *    2. eb_ucsize is zero (invalid).  2014-12-04 SMS.
       
    16 +     *    3. eb_ucsize is positive, but eb_size is too small to hold
       
    17 +     *       the compressed data header.
       
    18 +     */
       
    19      if ((eb_size < (EB_UCSIZE_P + 4)) ||
       
    20 -        ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
       
    21 -         eb_size <= (compr_offset + EB_CMPRHEADLEN)))
       
    22 -        return IZ_EF_TRUNC;               /* no compressed data! */
       
    23 +     ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
       
    24 +     ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
       
    25 +        return IZ_EF_TRUNC;             /* no/bad compressed data! */
       
    26  
       
    27      if (
       
    28  #ifdef INT_16BIT