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

index 1e6a66ec588773ab475d18a0b36e12f2b548998d..18821db8b4562fbcfcb668817eda09f13a3c6532 100644 (file)
@@ -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++) {