diff options
author | Loïc Minier <loic.minier@linaro.org> | 2010-08-22 00:47:23 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-08-30 18:29:22 +0200 |
commit | 2aa326be0d2039f51192707bdb2fc935d0e87c21 (patch) | |
tree | 6e460caa6cb72b54d5b4b36afa9d7ea1a48e2fb6 /block/vvfat.c | |
parent | cdbae85169c384d1641aa1ae86cdeefe16285745 (diff) | |
download | qemu-2aa326be0d2039f51192707bdb2fc935d0e87c21.tar.gz qemu-2aa326be0d2039f51192707bdb2fc935d0e87c21.tar.bz2 qemu-2aa326be0d2039f51192707bdb2fc935d0e87c21.zip |
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>
Diffstat (limited to 'block/vvfat.c')
-rw-r--r-- | block/vvfat.c | 2 |
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; } |