From 1a7b4189bfed21d776d77c589e155ea45a9e447c Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Thu, 6 Feb 2014 13:26:56 -0800 Subject: [PATCH] Detect a lack of digits in the exponent for a number --- jsonpull.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jsonpull.c b/jsonpull.c index e44cf2b..ff80ce4 100644 --- a/jsonpull.c +++ b/jsonpull.c @@ -310,6 +310,10 @@ again: } c = peek(f); + if (c < '0' || c > '9') { + *error = "Exponent without digits"; + return NULL; + } while (c >= '0' && c <= '9') { string_append(&val, getc(f)); c = peek(f);