From 8a2f6c5e60c8fe59935ccbd8dcee9f04c7b8cac6 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Sat, 29 Jan 2000 17:54:30 +0000 Subject: [PATCH] @- Fixed a crash bug in strtr() working on large input strings (Zeev) --- ext/standard/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index a12a04a9a67..8ebb5444d19 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++ ];