]> xenbits.xensource.com Git - qemu-xen.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)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 21 Jun 2018 01:45:01 +0000 (20:45 -0500)
commit44633a272b58cd03eecddd6c224e73f2a52e7ca1
tree1a4a1d74f7f21195fc40ecbfcd4c46fd368655ad
parent8999a5945fb9fbb35f41d4bdc80cd36616d05421
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>
(cherry picked from commit 07c13a71721d9f8c690b66752964e254af247475)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/block/pflash_cfi01.c
hw/block/pflash_cfi02.c