cvs: php-src(PHP_5_2) / NEWS /ext/standard metaphone.c /ext/standard/tests/strings bug44242.phpt
| From: | Felipe Pena | Date: | Mon, 25 Feb 2008 22:40:46 +0000 |
| Subject: | cvs: php-src(PHP_5_2) / NEWS /ext/standard metaphone.c /ext/standard/tests/strings bug44242.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-48759@lists.php.net to get a copy of this message | ||
felipe Mon Feb 25 22:40:46 2008 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings bug44242.phpt
Modified files:
/php-src/ext/standard metaphone.c
/php-src NEWS
Log:
Fixed bug #44242 (metaphone(CMXFXM) crashes PHP)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/metaphone.c?r1=1.28.2.1.2.5&r2=1.28.2.1.2.6&diff_format=u
Index: php-src/ext/standard/metaphone.c
diff -u php-src/ext/standard/metaphone.c:1.28.2.1.2.5 php-src/ext/standard/metaphone.c:1.28.2.1.2.6
--- php-src/ext/standard/metaphone.c:1.28.2.1.2.5 Mon Dec 31 07:20:13 2007
+++ php-src/ext/standard/metaphone.c Mon Feb 25 22:40:45 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: metaphone.c,v 1.28.2.1.2.5 2007/12/31 07:20:13 sebastian Exp $ */
+/* $Id: metaphone.c,v 1.28.2.1.2.6 2008/02/25 22:40:45 felipe Exp $ */
/*
Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern <schwern@pobox.com>
@@ -150,7 +150,12 @@
(*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)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1096&r2=1.2027.2.547.2.1097&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1096 php-src/NEWS:1.2027.2.547.2.1097
--- php-src/NEWS:1.2027.2.547.2.1096 Sun Feb 24 18:34:30 2008
+++ php-src/NEWS Mon Feb 25 22:40:45 2008
@@ -13,6 +13,7 @@
- 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)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug44242.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/bug44242.phpt
+++ php-src/ext/standard/tests/strings/bug44242.phpt