]> granicus.if.org Git - php/commitdiff
@- Fixed a crash bug in strtr() working on large input strings (Zeev)
authorZeev Suraski <zeev@php.net>
Sat, 29 Jan 2000 17:54:30 +0000 (17:54 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 29 Jan 2000 17:54:30 +0000 (17:54 +0000)
ext/standard/string.c

index a12a04a9a6778ae587176b840f5401a89318ce09..8ebb5444d19ae33bb0eb6cccc62487b751d0edb0 100644 (file)
@@ -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++ ];