]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
vnc: fix segfault in vnc_display_pw_expire()
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 24 May 2012 08:55:01 +0000 (10:55 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 30 May 2012 02:28:44 +0000 (10:28 +0800)
NULL pointer dereference in case no vnc server is configured.
Catch this and return -EINVAL like vnc_display_password() does.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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;
 }