diff options
author | Felipe Pena <felipe@php.net> | 2008-02-27 01:10:56 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-02-27 01:10:56 +0000 |
commit | 45e379b49d56b14804b163788b7f26f0086d4563 (patch) | |
tree | dbff77d0e2e5e14d3254c082674b330a97c392f1 | |
parent | 45c443576e0257caa0995b862bd0a1e52b55f99d (diff) | |
download | php-git-45e379b49d56b14804b163788b7f26f0086d4563.tar.gz |
Improved fix for #44242
-rw-r--r-- | ext/standard/metaphone.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 34952d8295..21e7cecb8c 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -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'; \ } |