php/php-5.2.1-strreplace.patch

12 lines
376 B
Diff
Raw Normal View History

--- php-5.2.1/ext/standard/string.c.strreplace
+++ php-5.2.1/ext/standard/string.c
@@ -3148,7 +3148,7 @@
}
Z_STRLEN_P(result) = len + (char_count * (to_len - 1));
- Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len);
+ Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len + 1);
Z_TYPE_P(result) = IS_STRING;
if (case_sensitivity) {