From: Ilia Alshanetsky Date: Mon, 8 Jan 2007 14:25:22 +0000 (+0000) Subject: MFH: Use safe_emalloc() rather then emalloc() X-Git-Tag: php-4.4.5RC2~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=257375765aa5c69eb390ec953085c5bea4eedd24;p=php MFH: Use safe_emalloc() rather then emalloc() --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 1e6a66ec58..18821db8b4 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2531,7 +2531,7 @@ PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int to_len, } Z_STRLEN_P(result) = len + (char_count * (to_len - 1)); - Z_STRVAL_P(result) = target = emalloc(Z_STRLEN_P(result) + 1); + Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len); Z_TYPE_P(result) = IS_STRING; for (source = str; source < source_end; source++) {