aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Minier <loic.minier@linaro.org>2010-08-22 00:47:23 +0200
committerKevin Wolf <kwolf@redhat.com>2010-08-30 18:44:13 +0200
commitf891f9f74dac3622848ea3c10d11ac1c0b81869c (patch)
tree79f64b4d03131690f6a9182b9c170785744f3f7f
parent271a24e7bf5f9e98b8d6180ed9462719c0e755f9 (diff)
vvfat: fat_chksum(): fix access above array bounds
Signed-off-by: Loïc Minier <loic.minier@linaro.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 2aa326be0d2039f51192707bdb2fc935d0e87c21)
-rw-r--r--block/vvfat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/vvfat.c b/block/vvfat.c
index 6d61c2e6c3..365332aa21 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;
}