From ad72aac67ab84280cbd7e08b2668ef7fe5db046e Mon Sep 17 00:00:00 2001 From: pt300 Date: Sat, 1 Oct 2016 18:07:35 +0200 Subject: [PATCH] Partialy fixes zserge/jsmn#81 Still will report invalid amount if we fetch it with something like "{"key 1": 1234}}" --- jsmn.c | 3 +++ 1 file changed, 3 insertions(+) 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];