qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v1][ 10/14] json-lexer: reset the lexer state on an


From: Michael Roth
Subject: [Qemu-devel] [PATCH v1][ 10/14] json-lexer: reset the lexer state on an invalid token
Date: Wed, 1 Jun 2011 12:14:56 -0500

From: Anthony Liguori <address@hidden>


Signed-off-by: Michael Roth <address@hidden>
---
 json-lexer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/json-lexer.c b/json-lexer.c
index fe5a060..a5bbe9e 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;
-- 
1.7.0.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]