Changeset 85cd12d


Ignore:
Timestamp:
2012-11-27T23:20:34Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e8161ec
Parents:
b235228
Message:

Fixing integer size issue in JSON parser: Although I've changed the integer
type to long long, the parser was still using strtol to convert numbers,
truncating large numbers to LONG_MAX. Bug found by Artem Savkov, thanks!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/json.c

    rb235228 r85cd12d  
    485485                              top->u.dbl = strtod (i, (json_char **) &i);
    486486                           else
    487                               top->u.integer = strtol (i, (json_char **) &i, 10);
     487                              top->u.integer = strtoll (i, (json_char **) &i, 10);
    488488
    489489                           flags |= flag_next | flag_reproc;
Note: See TracChangeset for help on using the changeset viewer.