[Spice-devel] [PATCH spice-server] test-qxl-parsing: Fix possible integer overflow

Frediano Ziglio fziglio at redhat.com
Wed Jun 12 13:37:04 UTC 2019


This fixes https://gitlab.freedesktop.org/spice/spice-server/issues/31.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/tests/test-qxl-parsing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/tests/test-qxl-parsing.c b/server/tests/test-qxl-parsing.c
index 60ca8f88c..76eab06ce 100644
--- a/server/tests/test-qxl-parsing.c
+++ b/server/tests/test-qxl-parsing.c
@@ -96,7 +96,7 @@ static void test_memslot_invalid_slot_id(void)
     RedMemSlotInfo mem_info;
     init_meminfo(&mem_info);
 
-    memslot_get_virt(&mem_info, 1 << mem_info.memslot_id_shift, 16, 0);
+    memslot_get_virt(&mem_info, ((QXLPHYSICAL) 1) << mem_info.memslot_id_shift, 16, 0);
 }
 
 static void test_memslot_invalid_addresses(void)
-- 
2.20.1



More information about the Spice-devel mailing list