diff --git a/jsmn.c b/jsmn.c index e7765eb..da9bf21 100644 --- a/jsmn.c +++ b/jsmn.c @@ -198,6 +198,9 @@ int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, break; } if (token->parent == -1) { + if(token->type != type) { + return JSMN_ERROR_INVAL; + } break; } token = &tokens[token->parent];