mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-08 02:06:42 +00:00
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>
This commit is contained in:
parent
cdbae85169
commit
2aa326be0d
@ -512,7 +512,7 @@ static inline uint8_t fat_chksum(const direntry_t* entry)
|
|||||||
for(i=0;i<11;i++) {
|
for(i=0;i<11;i++) {
|
||||||
unsigned char c;
|
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;
|
chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0)) + c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user