]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
pcihp: fix possible array out of bounds
authorGonglei <arei.gonglei@huawei.com>
Wed, 20 Aug 2014 05:52:30 +0000 (13:52 +0800)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Thu, 5 Mar 2015 12:24:34 +0000 (12:24 +0000)
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>
hw/acpi/pcihp.c

index f80c48008cb3aab6a0d5d1b0dcc4960c363d5f49..3351f8348647b7a4202b1f0141bd93fd0e5a4ee4 100644 (file)
@@ -229,7 +229,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;
     }