]> Git Repo - qemu.git/commitdiff
ui/spice-display: check NULL pointer in interface_release_resource()
authorMauro Matteo Cascella <[email protected]>
Thu, 20 May 2021 10:58:33 +0000 (12:58 +0200)
committerGerd Hoffmann <[email protected]>
Fri, 21 May 2021 07:42:44 +0000 (09:42 +0200)
Check rext.info to avoid potential NULL pointer dereference. A similar check
exists in interface_release_resource() in hw/display/qxl.c.

Reported-by: Yu Lu <[email protected]>
Signed-off-by: Mauro Matteo Cascella <[email protected]>
Reviewed-by: Prasad J Pandit <[email protected]>
Message-Id: <20210520105833[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
ui/spice-display.c

index d22781a23d06760cb84aefb17ee834ea9341efb7..f59c69882d91bd797c18798174400093d2f13cab 100644 (file)
@@ -561,6 +561,10 @@ static void interface_release_resource(QXLInstance *sin,
     SimpleSpiceCursor *cursor;
     QXLCommandExt *ext;
 
+    if (!rext.info) {
+        return;
+    }
+
     ext = (void *)(intptr_t)(rext.info->id);
     switch (ext->cmd.type) {
     case QXL_CMD_DRAW:
This page took 0.022824 seconds and 4 git commands to generate.