components/php-5_3/php-sapi/patches/280_php_20804024.patch
branchs11-update
changeset 4499 4e8085696007
equal deleted inserted replaced
4497:7665830787a5 4499:4e8085696007
       
     1 CVE-2014-9653
       
     2 Community BUG:
       
     3 https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-9653
       
     4 Community CODE:
       
     5 https://github.com/file/file/commit/445c8fb0ebff85195be94cd9f7e1df89cade5c7f
       
     6 This patch was adapted from the community reports above.
       
     7 
       
     8 
       
     9 --- php-5.3.29/ext/fileinfo/libmagic/readelf.c_orig	2015-06-12 16:40:10.463458900 -0700
       
    10 +++ php-5.3.29/ext/fileinfo/libmagic/readelf.c	2015-06-12 16:59:36.213626077 -0700
       
    11 @@ -313,7 +313,7 @@
       
    12  			file_badseek(ms);
       
    13  			return -1;
       
    14  		}
       
    15 -		if (FINFO_READ_FUNC(fd, xph_addr, xph_sizeof) == -1) {
       
    16 +		if (FINFO_READ_FUNC(fd, xph_addr, xph_sizeof) < (ssize_t)xph_sizeof) {
       
    17  			file_badread(ms);
       
    18  			return -1;
       
    19  		}
       
    20 @@ -869,7 +869,7 @@
       
    21  			file_badseek(ms);
       
    22  			return -1;
       
    23  		}
       
    24 -		if (FINFO_READ_FUNC(fd, xsh_addr, xsh_sizeof) == -1) {
       
    25 +		if (FINFO_READ_FUNC(fd, xsh_addr, xsh_sizeof) < (ssize_t)xsh_sizeof) {
       
    26  			file_badread(ms);
       
    27  			return -1;
       
    28  		}
       
    29 @@ -901,7 +901,7 @@
       
    30  				efree(nbuf);
       
    31  				return -1;
       
    32  			}
       
    33 -			if (FINFO_READ_FUNC(fd, nbuf, (size_t)xsh_size) !=
       
    34 +			if (FINFO_READ_FUNC(fd, nbuf, (size_t)xsh_size) <
       
    35  			    (ssize_t)xsh_size) {
       
    36  				efree(nbuf);
       
    37  				file_badread(ms);
       
    38 @@ -1058,7 +1058,7 @@
       
    39  			return -1;
       
    40  		}
       
    41  
       
    42 -  		if (FINFO_READ_FUNC(fd, xph_addr, xph_sizeof) == -1) {
       
    43 +  		if (FINFO_READ_FUNC(fd, xph_addr, xph_sizeof) < (ssize_t)xph_sizeof) {
       
    44    			file_badread(ms);
       
    45  			return -1;
       
    46  		}