diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-05-24 10:55:01 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-05-30 10:28:44 +0800 |
commit | 1643f2b232628905e8f32965ff36a87bd53b93c5 (patch) | |
tree | c03f698a9925bf08c98264a4ff1382c72be45c4a /ui/vnc.c | |
parent | 1352672860399b40965b5093dd026688979e60a5 (diff) |
vnc: fix segfault in vnc_display_pw_expire()
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>
Diffstat (limited to 'ui/vnc.c')
-rw-r--r-- | ui/vnc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; } |