summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/yajl_parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/yajl_parser.c b/src/yajl_parser.c
index 2cf8a07..9788022 100644
--- a/src/yajl_parser.c
+++ b/src/yajl_parser.c
@@ -51,6 +51,10 @@ yajl_parse_integer(const unsigned char *number, unsigned int length)
errno = ERANGE;
return sign == 1 ? LLONG_MAX : LLONG_MIN;
}
+ if (*pos < '0' || *pos > '9') {
+ errno = ERANGE;
+ return sign == 1 ? LLONG_MAX : LLONG_MIN;
+ }
ret += (*pos++ - '0');
}