felipe Thu, 01 Jul 2010 19:11:01 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=300917
Log:
- Fixed a possible memory corruption in strchr(), strstr().
- MFH: Fixed a possible memory corruption in substr_replace() (Dmitry)
Changed paths:
U php/php-src/branches/PHP_5_2/ext/standard/string.c
Modified: php/php-src/branches/PHP_5_2/ext/standard/string.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/string.c 2010-07-01 18:43:52 UTC
(rev 300916)
+++ php/php-src/branches/PHP_5_2/ext/standard/string.c 2010-07-01 19:11:01 UTC
(rev 300917)
@@ -1766,6 +1766,9 @@
WRONG_PARAM_COUNT;
}
+ if (PZVAL_IS_REF(*haystack)) {
+ SEPARATE_ZVAL(haystack);
+ }
convert_to_string_ex(haystack);
if (Z_TYPE_PP(needle) == IS_STRING) {
@@ -2341,12 +2344,21 @@
}
if (Z_TYPE_PP(str) != IS_ARRAY) {
+ if (PZVAL_IS_REF(*str)) {
+ SEPARATE_ZVAL(str);
+ }
convert_to_string_ex(str);
}
if (Z_TYPE_PP(repl) != IS_ARRAY) {
+ if (PZVAL_IS_REF(*repl)) {
+ SEPARATE_ZVAL(repl);
+ }
convert_to_string_ex(repl);
}
if (Z_TYPE_PP(from) != IS_ARRAY) {
+ if (PZVAL_IS_REF(*from)) {
+ SEPARATE_ZVAL(from);
+ }
convert_to_long_ex(from);
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php