]> Git Repo - qemu.git/commitdiff
vvfat: fat_chksum(): fix access above array bounds
authorLoïc Minier <[email protected]>
Sat, 21 Aug 2010 22:47:23 +0000 (00:47 +0200)
committerKevin Wolf <[email protected]>
Mon, 30 Aug 2010 16:29:22 +0000 (18:29 +0200)
Signed-off-by: Loïc Minier <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/vvfat.c

index 6d61c2e6c32f4b20f1a04ee7b757bc8ce949f30e..365332aa2124d5607eeef936746d59c11d8f450c 100644 (file)
@@ -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;
     }
 
This page took 0.029929 seconds and 4 git commands to generate.