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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user