]> Git Repo - qemu.git/commitdiff
pcihp: fix possible array out of bounds
authorGonglei <[email protected]>
Wed, 20 Aug 2014 05:52:30 +0000 (13:52 +0800)
committerMichael S. Tsirkin <[email protected]>
Sun, 24 Aug 2014 22:16:06 +0000 (00:16 +0200)
Prevent out-of-bounds array access on
acpi_pcihp_pci_status.

Signed-off-by: Gonglei <[email protected]>
Reviewed-by: Peter Crosthwaite <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Cc: [email protected]
Reviewed-by: Marcel Apfelbaum <[email protected]>
hw/acpi/pcihp.c

index fae663af117abddca40bdc2b1e19f89abd0d8619..34dedf1e8bfbcd212b4270fb76a247eadee71540 100644 (file)
@@ -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;
     }
 
This page took 0.024697 seconds and 4 git commands to generate.