]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/block/pflash_cfi: fix off-by-one error
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Wed, 4 Apr 2018 23:32:38 +0000 (20:32 -0300)
committerKevin Wolf <kwolf@redhat.com>
Tue, 10 Apr 2018 14:33:08 +0000 (16:33 +0200)
commit07c13a71721d9f8c690b66752964e254af247475
treebef5dfa093c6c296cf3a47d4efd650ab03d07290
parentfebc8c865f17d98876200ef687100ab93f57bcab
hw/block/pflash_cfi: fix off-by-one error

ASAN reported:

    hw/block/pflash_cfi02.c:245:33: runtime error: index 82 out of bounds for type 'uint8_t [82]'

Since the 'cfi_len' member is not used, remove it to keep the code safer.

Cc: qemu-stable@nongnu.org
Reported-by: AddressSanitizer
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/pflash_cfi01.c
hw/block/pflash_cfi02.c