Skip to contentSkip to conversation

hw/qxl: qxl_dirty_surfaces: use uintptr_t

PATCH In review Alon Levy 2 participants 2 messages Oct 7, 2012 – Oct 8, 2012

lore
Share & tools
lore

Alon Levy

author
#0 lore raw

PATCH 1/1 hw/qxl: qxl_dirty_surfaces: use uintptr_t

As suggested by Paolo Bonzini, to avoid possible integer overflow issues.

---
 hw/qxl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/qxl.c +2 -2
index 4effb66..97ae22a 100644
@@ -1811,7 +1811,7 @@ static void qxl_hw_text_update(void *opaque, console_ch_t *chardata)
 
 static void qxl_dirty_surfaces(PCIQXLDevice *qxl)
 {
-    intptr_t vram_start;
+    uintptr_t vram_start;
     int i;
 
     if (qxl->mode != QXL_MODE_NATIVE && qxl->mode != QXL_MODE_COMPAT) {
@@ -1822,7 +1822,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl)
     qxl_set_dirty(&qxl->vga.vram, qxl->shadow_rom.draw_area_offset,
                   qxl->shadow_rom.surface0_area_size);
 
-    vram_start =  (intptr_t)memory_region_get_ram_ptr(&qxl->vram_bar);
+    vram_start = (uintptr_t)memory_region_get_ram_ptr(&qxl->vram_bar);
 
     /* dirty the off-screen surfaces */
     for (i = 0; i < qxl->ssd.num_surfaces; i++) {
Signature · 1 line
1.7.12.1
#1 lore raw
Quoted 1 line · Alon Levy

As suggested by Paolo Bonzini, to avoid possible integer overflow issues.

Patch added to spice patch queue, likewise the other two qxl fixes.

thanks,
Gerd