- Upgraded PCRE to version 7.6 (Nuno)
+- Fixed bug #44242 (metaphone('CMXFXM') crashes PHP). (Felipe)
- Fixed bug #44216 (strftime segfaults on large negative value). (Derick)
- Fixed bug #44200 (A crash in PDO when no bound targets exists and yet
bound parameters are present). (Ilia)
(*phoned_word)[p_idx++] = c; \
}
/* Slap a null character on the end of the phoned word */
-#define End_Phoned_Word {(*phoned_word)[p_idx] = '\0';}
+#define End_Phoned_Word { \
+ if (p_idx == max_buffer_len) { \
+ *phoned_word = erealloc(*phoned_word, max_buffer_len + 1); \
+ } \
+ (*phoned_word)[p_idx] = '\0'; \
+ }
/* How long is the phoned word? */
#define Phone_Len (p_idx)
--- /dev/null
+--TEST--
+Bug #44242 (metaphone('CMXFXM') crashes PHP)
+--FILE--
+<?php
+
+echo metaphone('CMXFXZ'), "\n";
+echo metaphone('CMXFXV'), "\n";
+echo metaphone('CMXFXZXZ'), "\n";
+
+?>
+--EXPECT--
+KMKSFKSS
+KMKSFKSF
+KMKSFKSSKSS