[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1.1] vnc: fix segfault in vnc_display_pw_expire()
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 1.1] vnc: fix segfault in vnc_display_pw_expire() |
Date: |
Wed, 9 May 2012 11:41:06 +0200 |
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 <address@hidden>
---
ui/vnc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index deb9ecd..4408110 100644
--- 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;
}
--
1.7.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH 1.1] vnc: fix segfault in vnc_display_pw_expire(),
Gerd Hoffmann <=