cvs: php4 /ext/standard string.c
| From: | Ilia Alshanetsky | Date: | Wed, 16 Apr 2003 01:07:03 +0000 |
| Subject: | cvs: php4 /ext/standard string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20292@lists.php.net to get a copy of this message | ||
iliaa Tue Apr 15 21:07:03 2003 EDT
Modified files:
/php4/ext/standard string.c
Log:
Fixed bug #23225 (money_format() didn't handle erroneous return of strfmon)
# Initial patch proposed by marcot@tabini.ca
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.374 php4/ext/standard/string.c:1.375
--- php4/ext/standard/string.c:1.374 Sun Apr 13 18:59:19 2003
+++ php4/ext/standard/string.c Tue Apr 15 21:07:03 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.374 2003/04/13 22:59:19 pollita Exp $ */
+/* $Id: string.c,v 1.375 2003/04/16 01:07:03 iliaa Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -4372,7 +4372,10 @@
str_len = format_len + 1024;
str = emalloc(str_len);
- str_len = strfmon(str, str_len, format, value);
+ if ((str_len = strfmon(str, str_len, format, value)) < 0) {
+ efree(str);
+ RETURN_FALSE;
+ }
str[str_len] = 0;
RETURN_STRINGL(erealloc(str, str_len + 1), str_len, 0);