From: Felipe Pena Date: Wed, 27 Feb 2008 01:25:40 +0000 (+0000) Subject: MFB: Improved fix for #44242 X-Git-Tag: RELEASE_2_0_0a1~311 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65622011565d6cddb5e7a27e73cb428a9a7aa701;p=php MFB: Improved fix for #44242 --- diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 37e11ed0d7..40922ce2bc 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -145,7 +145,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; \ @@ -153,7 +153,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'; \ }