aboutsummaryrefslogtreecommitdiffstats
path: root/lib/json.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2012-11-27 23:20:34 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2012-11-27 23:20:34 +0000
commit85cd12daeea9dd537566735ee426974a19533337 (patch)
tree57745b15205336e4c1b03e701e5f768c9da450cb /lib/json.c
parentb235228768645c11d3ef138ddba839c7dd529567 (diff)
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!
Diffstat (limited to 'lib/json.c')
-rw-r--r--lib/json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/json.c b/lib/json.c
index e37c83fa..5cc18fad 100644
--- a/lib/json.c
+++ b/lib/json.c
@@ -484,7 +484,7 @@ json_value * json_parse_ex (json_settings * settings, const json_char * json, ch
if (top->type == json_double)
top->u.dbl = strtod (i, (json_char **) &i);
else
- top->u.integer = strtol (i, (json_char **) &i, 10);
+ top->u.integer = strtoll (i, (json_char **) &i, 10);
flags |= flag_next | flag_reproc;
}