mirror of https://gitlab.com/qemu-project/qemu
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>
This commit is contained in:
parent
1352672860
commit
1643f2b232
4
ui/vnc.c
4
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;
|
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
|
||||||
|
|
||||||
|
if (!vs) {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
vs->expires = expires;
|
vs->expires = expires;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue