Skip to content

Commit

Permalink
added check parser toksuper != -1
Browse files Browse the repository at this point in the history
  • Loading branch information
lunatikub committed Jun 13, 2018
1 parent 725ae2b commit 63dcd72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
if (parser->toksuper != -1 && tokens != NULL)
tokens[parser->toksuper].size++;
#ifdef JSMN_STRICT
if (tokens != NULL) {
if (tokens != NULL && parser->toksuper != -1) {
parser->toktype = jsmn_string_next_tok
(&tokens[parser->toksuper], parser->toktype);
}
Expand Down

0 comments on commit 63dcd72

Please sign in to comment.