aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Amsden <zamsden@redhat.com>2009-07-30 00:15:00 -1000
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-24 08:01:40 -0500
commit7ef923310a73b8de3e1a07e901b62a2c50dd36be (patch)
treec8e62a4fe1ff68388457b1479346fb9f3976b3d7
parent907500095851230a480b14bc852c4e49d32cb16d (diff)
Don't segfault when changing VNC password on an SDL display.
Signed-off-by: Zachary Amsden <zamsden@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--vnc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vnc.c b/vnc.c
index 4fde9aae5d..9dbe82ac06 100644
--- a/vnc.c
+++ b/vnc.c
@@ -2263,6 +2263,10 @@ int vnc_display_password(DisplayState *ds, const char *password)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
+ if (!vs) {
+ return -1;
+ }
+
if (vs->password) {
qemu_free(vs->password);
vs->password = NULL;