From patchwork Wed May 19 21:15:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 53024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0882BB7BEE for ; Thu, 20 May 2010 07:18:45 +1000 (EST) Received: from localhost ([127.0.0.1]:40009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEqf4-0003Ii-0c for incoming@patchwork.ozlabs.org; Wed, 19 May 2010 17:18:42 -0400 Received: from [140.186.70.92] (port=44984 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEqcL-0002Ix-G2 for qemu-devel@nongnu.org; Wed, 19 May 2010 17:15:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEqcJ-0007C2-GK for qemu-devel@nongnu.org; Wed, 19 May 2010 17:15:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29281) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEqcI-0007Bs-Et for qemu-devel@nongnu.org; Wed, 19 May 2010 17:15:51 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4JLFm2S010354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 May 2010 17:15:48 -0400 Received: from localhost (vpn-8-1.rdu.redhat.com [10.11.8.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4JLFk9j010968; Wed, 19 May 2010 17:15:47 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Wed, 19 May 2010 18:15:29 -0300 Message-Id: <1274303733-3700-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1274303733-3700-1-git-send-email-lcapitulino@redhat.com> References: <1274303733-3700-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 2/6] json-lexer: Handle missing escapes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The JSON escape sequence "\/" and "\\" are valid and should be handled. Signed-off-by: Luiz Capitulino --- json-lexer.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/json-lexer.c b/json-lexer.c index 0b145d1..5cc7e6c 100644 --- a/json-lexer.c +++ b/json-lexer.c @@ -97,6 +97,8 @@ static const uint8_t json_lexer[][256] = { ['n'] = IN_DQ_STRING, ['r'] = IN_DQ_STRING, ['t'] = IN_DQ_STRING, + ['/'] = IN_DQ_STRING, + ['\\'] = IN_DQ_STRING, ['\''] = IN_DQ_STRING, ['\"'] = IN_DQ_STRING, ['u'] = IN_DQ_UCODE0, @@ -134,6 +136,8 @@ static const uint8_t json_lexer[][256] = { ['n'] = IN_SQ_STRING, ['r'] = IN_SQ_STRING, ['t'] = IN_SQ_STRING, + ['/'] = IN_DQ_STRING, + ['\\'] = IN_DQ_STRING, ['\''] = IN_SQ_STRING, ['\"'] = IN_SQ_STRING, ['u'] = IN_SQ_UCODE0,