mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2024-12-03 10:41:56 +03:00
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>
This commit is contained in:
parent
11e8a46cc3
commit
529a0ef5f3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user