vnc: fix segfault in vnc_display_pw_expire()
PATCH 1/1 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 <[email protected]>
--- ui/vnc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
ui/vnc.c +4 -0
@@ -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 ; }
Signature · 1 line
1.7.1