summaryrefslogtreecommitdiff
path: root/jsmn.c
diff options
context:
space:
mode:
authorpt300 <pt300@tlen.pl>2016-10-01 18:07:35 +0200
committerpt300 <pt300@tlen.pl>2016-10-01 18:07:35 +0200
commitad72aac67ab84280cbd7e08b2668ef7fe5db046e (patch)
treee4fb919ebd894e4b291ebe0210b6a962ca70af46 /jsmn.c
parent6021415cc75e7922d45b12935f56348b064d8a7f (diff)
Partialy fixes zserge/jsmn#81
Still will report invalid amount if we fetch it with something like "{"key 1": 1234}}"
Diffstat (limited to 'jsmn.c')
-rw-r--r--jsmn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/jsmn.c b/jsmn.c
index e7765eb1d..da9bf217c 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];