components/php-5_2/php-sapi/patches/61_php_19003253.patch
changeset 4073 4f086b95f18c
parent 4071 4b68c2b0134b
child 4074 3b59c13ef5ec
equal deleted inserted replaced
4071:4b68c2b0134b 4073:4f086b95f18c
     1 Fix for CVE-2014-4049
       
     2 Community bug:
       
     3 https://bugs.php.net/bug.php?id=67432
       
     4 Patch based on:
       
     5 https://github.com/php/php-src/commit/b34d7849ed90ced9345f8ea1c59bc8d101c18468
       
     6 Slightly modified from the above source as the context is slightly different.
       
     7 
       
     8 
       
     9 --- php-5.2.17/ext/standard/dns.c_orig	2010-01-03 01:23:27.000000000 -0800
       
    10 +++ php-5.2.17/ext/standard/dns.c	2014-10-17 11:12:46.117985578 -0700
       
    11 @@ -484,6 +484,10 @@
       
    12  				
       
    13  				while (ll < dlen) {
       
    14  					n = cp[ll];
       
    15 +					if ((ll + n) >= dlen) {
       
    16 +						    // Invalid chunk length, truncate
       
    17 +							n = dlen - (ll + 1);
       
    18 +				    }
       
    19  					memcpy(tp + ll , cp + ll + 1, n);
       
    20  					ll = ll + n + 1;
       
    21  				}