From: Antony Dovgal Date: Sat, 10 Feb 2007 00:48:17 +0000 (+0000) Subject: fix off-by-one accidentally introduced by safe_emalloc() patch X-Git-Tag: RELEASE_1_0_1~290 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2fd25026ea144ce1997366ba1897d2422111a6bd;p=php fix off-by-one accidentally introduced by safe_emalloc() patch --- 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) {