From 2fd25026ea144ce1997366ba1897d2422111a6bd Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Sat, 10 Feb 2007 00:48:17 +0000 Subject: [PATCH] fix off-by-one accidentally introduced by safe_emalloc() patch --- ext/standard/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 7b484e3896..e9276fc036 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4914,7 +4914,7 @@ PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_l } 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) { -- 2.40.0