aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-08-20 13:52:30 +0800
committerMichael S. Tsirkin <mst@redhat.com>2014-08-25 00:16:06 +0200
commitfa365d7cd11185237471823a5a33d36765454e16 (patch)
treefdcc5938ae5dd0b2301dc04584326c00a2e39e3c
parent9f6b2f1c6497adcce4dec9b3bd1f1e78877a03dd (diff)
downloadqemu-arm-fa365d7cd11185237471823a5a33d36765454e16.tar.gz
pcihp: fix possible array out of bounds
Prevent out-of-bounds array access on acpi_pcihp_pci_status. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Cc: qemu-stable@nongnu.org Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
-rw-r--r--hw/acpi/pcihp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index fae663af11..34dedf1e8b 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -231,7 +231,7 @@ static uint64_t pci_read(void *opaque, hwaddr addr, unsigned int size)
uint32_t val = 0;
int bsel = s->hotplug_select;
- if (bsel < 0 || bsel > ACPI_PCIHP_MAX_HOTPLUG_BUS) {
+ if (bsel < 0 || bsel >= ACPI_PCIHP_MAX_HOTPLUG_BUS) {
return 0;
}