qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ui/spice-display: check NULL pointer in interface_release_resour


From: Mauro Matteo Cascella
Subject: [PATCH] ui/spice-display: check NULL pointer in interface_release_resource()
Date: Thu, 20 May 2021 12:58:33 +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 <ini.universe@gmail.com>
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
---
 ui/spice-display.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ui/spice-display.c b/ui/spice-display.c
index d22781a23d..f59c69882d 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -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:
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]