Re: cvs: php-src /ext/json JSON_parser.c
| From: | Scott MacVicar | Date: | Tue, 17 Mar 2009 15:08:47 +0000 |
| Subject: | Re: cvs: php-src /ext/json JSON_parser.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-56574@lists.php.net to get a copy of this message | ||
Nope, this is just for us when creating zvals.
http://marc.info/?l=php-cvs&m=123086535705859&w=2
Needs to be merged though.
Scott
Rasmus Lerdorf wrote:
> 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);
>> }
>>
>>
>>
>