1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00

Fixed a possible memory corruption in substr_replace()

This commit is contained in:
Dmitry Stogov
2010-05-11 11:59:13 +00:00
parent f4b927a42b
commit 2c5fecfeb4
+9
View File
@@ -2219,12 +2219,21 @@ PHP_FUNCTION(substr_replace)
}
if (Z_TYPE_PP(str) != IS_ARRAY) {
if (Z_ISREF_PP(str)) {
SEPARATE_ZVAL(str);
}
convert_to_string_ex(str);
}
if (Z_TYPE_PP(repl) != IS_ARRAY) {
if (Z_ISREF_PP(repl)) {
SEPARATE_ZVAL(repl);
}
convert_to_string_ex(repl);
}
if (Z_TYPE_PP(from) != IS_ARRAY) {
if (Z_ISREF_PP(from)) {
SEPARATE_ZVAL(from);
}
convert_to_long_ex(from);
}