qxl: check release info object
authorPrasad J Pandit <pjp@fedoraproject.org>
Thu, 25 Apr 2019 06:35:34 +0000 (12:05 +0530)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 7 May 2019 07:11:27 +0000 (09:11 +0200)
When releasing spice resources in release_resource() routine,
if release info object 'ext.info' is null, it leads to null
pointer dereference. Add check to avoid it.

Reported-by: Bugs SysSec <bugs-syssec@rub.de>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 20190425063534.32747-1-ppandit@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/qxl.c

index c8ce5781e037fa607966b9027fa3776f87a337db..632923add2395558f2abe1ab4aff30508af41f8b 100644 (file)
@@ -777,6 +777,9 @@ static void interface_release_resource(QXLInstance *sin,
     QXLReleaseRing *ring;
     uint64_t *item, id;
 
+    if (!ext.info) {
+        return;
+    }
     if (ext.group_id == MEMSLOT_GROUP_HOST) {
         /* host group -> vga mode update request */
         QXLCommandExt *cmdext = (void *)(intptr_t)(ext.info->id);