com php-src: Fixed bug #70140 (str_ireplace/php_string_ tolower - Arbitrary Code Execution): NEWS ext/s tandard/string.c

From: Date: Mon, 27 Jul 2015 03:17:05 +0000
Subject: com php-src: Fixed bug #70140 (str_ireplace/php_string_ tolower - Arbitrary Code Execution): NEWS ext/s tandard/string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88174@lists.php.net to get a copy of this message
Commit: 6aeee47b2cd47915ccfa3b41433a3f57aea24dd5 Author: Xinchen Hui <laruence@php.net> Mon, 27 Jul 2015 11:17:05 +0800 Parents: d44fc4a07361d2527dd7073b09e5e88134708858 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6aeee47b2cd47915ccfa3b41433a3f57aea24dd5 Log: Fixed bug #70140 (str_ireplace/php_string_tolower - Arbitrary Code Execution) Bugs: https://bugs.php.net/70140 Changed paths: M NEWS M ext/standard/string.c Diff: diff --git a/NEWS b/NEWS index 66441f7..384f11e 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,10 @@ PHP NEWS . Fixed bug #70111 (Segfault when a function uses both an explicit return type and an explicit cast). (Laruence) +- Standard: + . Fixed bug #70140 (str_ireplace/php_string_tolower - Arbitrary Code + Execution). (Laruence) + 23 Jul 2015, PHP 7.0.0 Beta 2 - Core: diff --git a/ext/standard/string.c b/ext/standard/string.c index bb482ba..2a9ddb2 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4055,7 +4055,7 @@ static zend_long php_str_replace_in_subject(zval *search, zval *replace, zval *s Z_STRVAL_P(search), Z_STRLEN_P(search), Z_STRVAL_P(replace), Z_STRLEN_P(replace), &replace_count)); } else { - lc_subject_str = php_string_tolower(Z_STR_P(subject)); + lc_subject_str = php_string_tolower(subject_str); ZVAL_STR(result, php_str_to_str_i_ex(subject_str, ZSTR_VAL(lc_subject_str), Z_STR_P(search), Z_STRVAL_P(replace), Z_STRLEN_P(replace), &replace_count));

« previous php.cvs (#88174) next »