From patchwork Wed Jun 1 17:14:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 98303 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E83B0B6F90 for ; Thu, 2 Jun 2011 10:18:29 +1000 (EST) Received: from localhost ([::1]:47255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRvcI-00015t-FK for incoming@patchwork.ozlabs.org; Wed, 01 Jun 2011 20:18:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRvZM-00015Q-TM for qemu-devel@nongnu.org; Wed, 01 Jun 2011 20:15:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRvZL-0000iu-6Y for qemu-devel@nongnu.org; Wed, 01 Jun 2011 20:15:24 -0400 Received: from mout.perfora.net ([74.208.4.194]:60297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRp3T-0007wJ-IY for qemu-devel@nongnu.org; Wed, 01 Jun 2011 13:18:03 -0400 Received: from localhost.localdomain ([32.97.110.59]) by mrelay.perfora.net (node=mrus4) with ESMTP (Nemesis) id 0MHHEh-1QN6Ei16PL-00E4le; Wed, 01 Jun 2011 13:18:02 -0400 From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 1 Jun 2011 12:14:56 -0500 Message-Id: <1306948500-15086-11-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1306948500-15086-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1306948500-15086-1-git-send-email-mdroth@linux.vnet.ibm.com> X-Provags-ID: V02:K0:QR/HQ7AdRmghWzpV8Gl1kgFYHSQq3GHIG3hXUDHvgmY 6jAbtDqrueOPYZK1QDbqLRdzFaXQ7/JDZGKZqLGKyjuQ4xTNoL hWhNER8BlflfymmvF3YubQIniiVFfF5MBPZNti7tjIiCJ8xMkZ y/5HUpar5pERXvCtNiSbWzyLoS74aJZiHhDdE/04t99kHOMCKj H6nMH0LnRMN44g2L06OB+dJtEkoKoBbTpdfcH3+bLI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.208.4.194 Cc: aliguori@linux.vnet.ibm.com, Jes.Sorensen@redhat.com, agl@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v1][ 10/14] json-lexer: reset the lexer state on an invalid token X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Anthony Liguori Signed-off-by: Michael Roth --- 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;