cvs: php4 /ext/standard math.c
| From: | Edin Kadribasic | Date: | Tue, 18 Jun 2002 00:04:35 +0000 |
| Subject: | cvs: php4 /ext/standard math.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12392@lists.php.net to get a copy of this message | ||
edink Mon Jun 17 20:04:35 2002 EDT
Modified files:
/php4/ext/standard math.c
Log:
Check for +/- infinity in base_convert (bug #14807).
Index: php4/ext/standard/math.c
diff -u php4/ext/standard/math.c:1.83 php4/ext/standard/math.c:1.84
--- php4/ext/standard/math.c:1.83 Mon Apr 1 04:19:57 2002
+++ php4/ext/standard/math.c Mon Jun 17 20:04:33 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.83 2002/04/01 09:19:57 derick Exp $ */
+/* $Id: math.c,v 1.84 2002/06/18 00:04:33 edink Exp $ */
#include "php.h"
#include "php_math.h"
@@ -769,6 +769,13 @@
double fvalue = floor(Z_DVAL_P(arg)); /* floor it just in case */
char *ptr, *end;
char buf[(sizeof(double) << 3) + 1];
+
+ /* Don't try to convert +/- infinity */
+ if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) {
+ php_error(E_WARNING, "Number too large in %s() call",
+ get_active_function_name(TSRMLS_C));
+ return empty_string;
+ }
end = ptr = buf + sizeof(buf) - 1;
*ptr = '\0';