mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-03 15:32:26 -06: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
1 changed files with 3 additions and 0 deletions
|
@ -305,6 +305,9 @@ static int json_lexer_feed_char(JSONLexer *lexer, char ch)
|
||||||
new_state = IN_START;
|
new_state = IN_START;
|
||||||
break;
|
break;
|
||||||
case IN_ERROR:
|
case IN_ERROR:
|
||||||
|
QDECREF(lexer->token);
|
||||||
|
lexer->token = qstring_new();
|
||||||
|
new_state = IN_START;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue