Received: from eggs.gnu.org ([2001:4830:134:3::10]:56795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLg6u-0001EV-15 for qemu-devel@nongnu.org; Sun, 24 Aug 2014 18:18:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLg6p-0000Hk-5w for qemu-devel@nongnu.org; Sun, 24 Aug 2014 18:18:03 -0400 Date: Mon, 25 Aug 2014 00:18:21 +0200 From: "Michael S. Tsirkin" Message-ID: <1408918641-14167-4-git-send-email-mst@redhat.com> References: <1408918641-14167-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1408918641-14167-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 03/11] pcihp: fix possible array out of bounds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , qemu-stable@nongnu.org, Gonglei , Anthony Liguori , Marcel Apfelbaum From: Gonglei Prevent out-of-bounds array access on acpi_pcihp_pci_status. Signed-off-by: Gonglei Reviewed-by: Peter Crosthwaite Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Cc: qemu-stable@nongnu.org Reviewed-by: Marcel Apfelbaum --- hw/acpi/pcihp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index fae663a..34dedf1 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; } -- MST