mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-14 12:07:25 +00: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;
|
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…
Reference in New Issue
Block a user