]> granicus.if.org Git - php/commitdiff
MFB: Improved fix for #44242
authorFelipe Pena <felipe@php.net>
Wed, 27 Feb 2008 01:19:05 +0000 (01:19 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 27 Feb 2008 01:19:05 +0000 (01:19 +0000)
ext/standard/metaphone.c

index 34952d82956996bd5b6b1f34996f995ca58bdfae..21e7cecb8c68fa6b1f040cc35c9d5731cfcb76e9 100644 (file)
@@ -144,7 +144,7 @@ static char Lookahead(char *word, int how_far)
  * could be one though; or more too). */
 #define Phonize(c)     { \
                                                if (p_idx >= max_buffer_len) { \
-                                                       *phoned_word = erealloc(*phoned_word, max_buffer_len + 2); \
+                                                       *phoned_word = safe_erealloc(*phoned_word, 2, sizeof(char), max_buffer_len); \
                                                        max_buffer_len += 2; \
                                                } \
                                                (*phoned_word)[p_idx++] = c; \
@@ -152,7 +152,7 @@ static char Lookahead(char *word, int how_far)
 /* Slap a null character on the end of the phoned word */
 #define End_Phoned_Word        { \
                                                        if (p_idx == max_buffer_len) { \
-                                                               *phoned_word = erealloc(*phoned_word, max_buffer_len + 1); \
+                                                               *phoned_word = safe_erealloc(*phoned_word, 1, sizeof(char), max_buffer_len); \
                                                        } \
                                                        (*phoned_word)[p_idx] = '\0'; \
                                                }