Received: from [140.186.70.92] (port=36613 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Omwxe-0003TA-Nn for qemu-devel@nongnu.org; Sat, 21 Aug 2010 18:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OmwrB-0002KS-Qt for qemu-devel@nongnu.org; Sat, 21 Aug 2010 18:48:14 -0400 Received: from duck.dooz.org ([194.146.227.125]:53086) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmwrB-0002Ji-MD for qemu-devel@nongnu.org; Sat, 21 Aug 2010 18:48:09 -0400 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Sun, 22 Aug 2010 00:47:23 +0200 Message-Id: <1282430843-32308-1-git-send-email-loic.minier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] fat_chksum(): fix access above array bounds List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Lo=C3=AFc=20Minier?= Signed-off-by: Lo=C3=AFc Minier --- 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* en= try) for(i=3D0;i<11;i++) { unsigned char c; =20 - c =3D (i <=3D 8) ? entry->name[i] : entry->extension[i-8]; + c =3D (i < 8) ? entry->name[i] : entry->extension[i-8]; chksum=3D(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0)) + c; } =20 --=20 1.7.1