]> git.proxmox.com Git - qemu.git/blobdiff - ui/vnc.c
vnc: fix segfault in vnc_display_pw_expire()
[qemu.git] / ui / vnc.c
index be384a5315ac7f930cd79fe26bd0b61d0b30286b..54bc5adab6710035f5f56714ee1a0955598d7ef6 100644 (file)
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2849,6 +2849,10 @@ int vnc_display_pw_expire(DisplayState *ds, time_t expires)
 {
     VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
 
+    if (!vs) {
+        return -EINVAL;
+    }
+
     vs->expires = expires;
     return 0;
 }