From: Zeev Suraski Date: Sat, 29 Jan 2000 17:54:30 +0000 (+0000) Subject: @- Fixed a crash bug in strtr() working on large input strings (Zeev) X-Git-Tag: BEFORE_SAPIFICATION_FEB_10_2000~149 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a2f6c5e60c8fe59935ccbd8dcee9f04c7b8cac6;p=php @- Fixed a crash bug in strtr() working on large input strings (Zeev) --- diff --git a/ext/standard/string.c b/ext/standard/string.c index a12a04a9a6..8ebb5444d1 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1215,7 +1215,7 @@ static void php_strtr_array(zval *return_value,char *str,int slen,HashTable *has if ((newpos + tlen + 1) > newlen) { newlen = newpos + tlen + 1 + 8192; - newstr = realloc(newstr,newlen); + newstr = erealloc(newstr,newlen); } memcpy(newstr+newpos,tval,tlen); @@ -1233,7 +1233,7 @@ static void php_strtr_array(zval *return_value,char *str,int slen,HashTable *has if (! found) { if ((newpos + 1) > newlen) { newlen = newpos + 1 + 8192; - newstr = realloc(newstr,newlen); + newstr = erealloc(newstr,newlen); } newstr[ newpos++ ] = str[ pos++ ];