]> granicus.if.org Git - php/commitdiff
MFB: Use safe_emalloc() rather then emalloc()
authorIlia Alshanetsky <iliaa@php.net>
Mon, 8 Jan 2007 14:25:49 +0000 (14:25 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 8 Jan 2007 14:25:49 +0000 (14:25 +0000)
ext/standard/string.c

index 80d9c8ab9f668829f290e5ec523a5310f3aedfc4..7b484e389687510aa4227142f53d43b1b871df95 100644 (file)
@@ -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 = emalloc(Z_STRLEN_P(result) + 1);
+       Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len);
        Z_TYPE_P(result) = IS_STRING;
 
        if (case_sensitivity) {