render / rpms / qemu

Forked from rpms/qemu 11 months ago
Clone

Blame 0401-qxl-Slot-sanity-check-in-qxl_phys2virt-is-off-by-one.patch

56753f
From 8858b6d0dac346d9f841cfa84f57cb03bffdf050 Mon Sep 17 00:00:00 2001
56753f
From: Markus Armbruster <armbru@redhat.com>
56753f
Date: Fri, 4 Nov 2011 10:34:24 +0100
56753f
Subject: [PATCH 401/434] qxl: Slot sanity check in qxl_phys2virt() is off by
56753f
 one, fix
56753f
56753f
Spotted by Coverity.
56753f
56753f
Signed-off-by: Markus Armbruster <armbru@redhat.com>
56753f
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
56753f
---
56753f
 hw/qxl.c |    2 +-
56753f
 1 file changed, 1 insertion(+), 1 deletion(-)
56753f
56753f
diff --git a/hw/qxl.c b/hw/qxl.c
56753f
index 41500e9..e0f9d4a 100644
56753f
--- a/hw/qxl.c
56753f
+++ b/hw/qxl.c
56753f
@@ -1020,7 +1020,7 @@ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, int group_id)
56753f
     case MEMSLOT_GROUP_HOST:
56753f
         return (void*)offset;
56753f
     case MEMSLOT_GROUP_GUEST:
56753f
-        PANIC_ON(slot > NUM_MEMSLOTS);
56753f
+        PANIC_ON(slot >= NUM_MEMSLOTS);
56753f
         PANIC_ON(!qxl->guest_slots[slot].active);
56753f
         PANIC_ON(offset < qxl->guest_slots[slot].delta);
56753f
         offset -= qxl->guest_slots[slot].delta;
56753f
-- 
56753f
1.7.10
56753f