diff options
-rw-r--r-- | jsmn/jsmn.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/jsmn/jsmn.c b/jsmn/jsmn.c index 853c3f1..2de5ec2 100644 --- a/jsmn/jsmn.c +++ b/jsmn/jsmn.c @@ -170,6 +170,10 @@ int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, if (token == NULL) return JSMN_ERROR_NOMEM; if (parser->toksuper != -1) { + if (tokens[parser->toksuper].type == JSMN_OBJECT) { + /* Object keys must be strings, not objects or arrays */ + return JSMN_ERROR_INVAL; + } tokens[parser->toksuper].size++; #ifdef JSMN_PARENT_LINKS token->parent = parser->toksuper; |