aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Matteo Cascella <mcascell@redhat.com>2021-05-20 12:58:33 +0200
committerGerd Hoffmann <kraxel@redhat.com>2021-05-21 09:42:44 +0200
commite932e9f327650d4a3f745539e8c4bf4f72a08015 (patch)
tree876b955977a2ad0fefb91af5ce8c7da95f80656f
parent4087ecb84227bf16f4481377a3bbe79fc87e1ada (diff)
downloadqemu-e932e9f327650d4a3f745539e8c4bf4f72a08015.zip
qemu-e932e9f327650d4a3f745539e8c4bf4f72a08015.tar.gz
qemu-e932e9f327650d4a3f745539e8c4bf4f72a08015.tar.bz2
ui/spice-display: check NULL pointer in interface_release_resource()
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> Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org> Message-Id: <20210520105833.183160-1-mcascell@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--ui/spice-display.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c
index d22781a..f59c698 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: