diff options
author | 2011-06-01 12:14:56 -0500 | |
---|---|---|
committer | 2011-06-07 13:52:11 -0500 | |
commit | 529a0ef5f30e28a801d6527a3556adcaa4959669 (patch) | |
tree | 7ae5aeed813137dd9ccbf1f62ceb8e88b1b35480 /json-lexer.c | |
parent | json-parser: detect premature EOI (diff) | |
download | qemu-529a0ef5f30e28a801d6527a3556adcaa4959669.tar.xz qemu-529a0ef5f30e28a801d6527a3556adcaa4959669.zip |
json-lexer: reset the lexer state on an invalid token
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'json-lexer.c')
-rw-r--r-- | json-lexer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/json-lexer.c b/json-lexer.c index fe5a060d4d..a5bbe9e54d 100644 --- a/json-lexer.c +++ b/json-lexer.c @@ -305,6 +305,9 @@ static int json_lexer_feed_char(JSONLexer *lexer, char ch) new_state = IN_START; break; case IN_ERROR: + QDECREF(lexer->token); + lexer->token = qstring_new(); + new_state = IN_START; return -EINVAL; default: break; |