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 <pbonzini@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-stable@nongnu.org
This commit is contained in:
Paolo Bonzini 2014-12-10 10:17:36 +01:00 committed by Michael Tokarev
parent b629a38a13
commit 9feb8adeaa
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@
typedef struct SuperIOConfig
{
uint8_t config[0xff];
uint8_t config[0x100];
uint8_t index;
uint8_t data;
} SuperIOConfig;