From 2aa326be0d2039f51192707bdb2fc935d0e87c21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lo=C3=AFc=20Minier?= Date: Sun, 22 Aug 2010 00:47:23 +0200 Subject: [PATCH] vvfat: fat_chksum(): fix access above array bounds MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Loïc Minier Signed-off-by: Kevin Wolf --- block/vvfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.7.4