Does this need to go upstream to the json.org version? Scott MacVicar wrote: > scottmac Tue Mar 17 14:56:49 2009 UTC > > Modified files: > /php-src/ext/json JSON_parser.c > Log: > Deal with overflow when decoding large numbers > > > > http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.23&r2=1.24&diff_format=u > Index: php-src/ext/json/JSON_parser.c > diff -u php-src/ext/json/JSON_parser.c:1.23 > php-src/ext/json/JSON_parser.c:1.24 > --- php-src/ext/json/JSON_parser.c:1.23 Tue Mar 17 02:00:08 2009 > +++ php-src/ext/json/JSON_parser.c Tue Mar 17 14:56:49 2009 > @@ -290,8 +290,9 @@ > if (type == IS_LONG) > { > long l = strtol(buf->c, NULL, 10); > - if (l > LONG_MAX || l < LONG_MIN) { > - ZVAL_DOUBLE(*z, zend_strtod(buf->c, NULL)); > + double d = zend_strtod(buf->c, NULL); > + if (d > LONG_MAX || d < LONG_MIN) { > + ZVAL_DOUBLE(*z, d); > } else { > ZVAL_LONG(*z, l); > } > > >
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php