sim-card
/
qemu
Archived
10
0
Fork 0

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:
Anthony Liguori 2011-06-01 12:14:56 -05:00
parent 11e8a46cc3
commit 529a0ef5f3
1 changed files with 3 additions and 0 deletions

View File

@ -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;