From patchwork Mon Aug 30 16:32:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 63104 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 4678CB70F9 for ; Tue, 31 Aug 2010 03:35:18 +1000 (EST) Received: from localhost ([127.0.0.1]:37240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq8Ds-0004ZP-5M for incoming@patchwork.ozlabs.org; Mon, 30 Aug 2010 13:32:44 -0400 Received: from [140.186.70.92] (port=42442 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7IL-0001ye-JH for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:34:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq7Hb-00054G-8T for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:32:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35019) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq7Ha-00053y-UA for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:32:31 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7UGWTns013328 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Aug 2010 12:32:29 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7UGWKtg029322; Mon, 30 Aug 2010 12:32:28 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 30 Aug 2010 18:32:29 +0200 Message-Id: <1283185953-30639-7-git-send-email-kwolf@redhat.com> In-Reply-To: <1283185953-30639-1-git-send-email-kwolf@redhat.com> References: <1283185953-30639-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id o7UGWTns013328 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 06/10] vvfat: fat_chksum(): fix access above array bounds 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 From: Loïc Minier Signed-off-by: Loïc Minier Signed-off-by: Kevin Wolf --- block/vvfat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index 6d61c2e..365332a 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -512,7 +512,7 @@ static inline uint8_t fat_chksum(const direntry_t* entry) for(i=0;i<11;i++) { unsigned char c; - c = (i <= 8) ? entry->name[i] : entry->extension[i-8]; + c = (i < 8) ? entry->name[i] : entry->extension[i-8]; chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0)) + c; }