From: Paolo Bonzini Date: Wed, 10 Dec 2014 09:17:36 +0000 (+0100) Subject: vt82c686: avoid out-of-bounds read X-Git-Tag: qemu-xen-4.7.0-rc1~500^2~11 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9feb8adeaa850d15b930c30f22c1ed2f2f695172;p=qemu-xen.git vt82c686: avoid out-of-bounds read superio_ioport_readb can read the 256th element of the array. Coverity reports an out-of-bounds write in superio_ioport_writeb, but it does not show the corresponding out-of-bounds read because it cannot prove that it can happen. Fix the root cause of the problem (zhanghailang's patch instead fixes the logic in superio_ioport_writeb). Signed-off-by: Paolo Bonzini Reviewed-by: zhanghailiang Signed-off-by: Michael Tokarev Cc: qemu-stable@nongnu.org --- diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 223b947939..2f53bf8194 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -36,7 +36,7 @@ typedef struct SuperIOConfig { - uint8_t config[0xff]; + uint8_t config[0x100]; uint8_t index; uint8_t data; } SuperIOConfig;