From: Anthony Liguori Date: Wed, 1 Jun 2011 17:14:56 +0000 (-0500) Subject: json-lexer: reset the lexer state on an invalid token X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~1405^2~17^2~2081 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=529a0ef5f30e28a801d6527a3556adcaa4959669;p=sdk%2Femulator%2Fqemu.git json-lexer: reset the lexer state on an invalid token Signed-off-by: Michael Roth Signed-off-by: Anthony Liguori --- 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;