Skip to content

Commit

Permalink
Merge pull request #371 from pallas/json-parse-fix
Browse files Browse the repository at this point in the history
json: avoid buffer overread in Json::parse_primitive
  • Loading branch information
kohler authored Sep 19, 2017
2 parents 2d413fb + 2a74ad0 commit 31a6577
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elements/json/json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ Json::parse_primitive(const String &str, const char *begin, const char *end)
++s;
if (s != end && (*s == '+' || *s == '-'))
++s;
if (s == end || s[1] < '0' || s[1] > '9')
if (s == end || s[0] < '0' || s[0] > '9')
return 0;
for (++s; s != end && isdigit((unsigned char) *s); )
++s;
Expand Down

0 comments on commit 31a6577

Please sign in to comment.