]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
Don't segfault when changing VNC password on an SDL display.
authorZachary Amsden <zamsden@redhat.com>
Thu, 30 Jul 2009 10:15:00 +0000 (00:15 -1000)
committerGlauber Costa <glommer@redhat.com>
Tue, 25 Aug 2009 20:28:30 +0000 (16:28 -0400)
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
vnc.c

diff --git a/vnc.c b/vnc.c
index c0700c066e90de4096ffc9008702312515bf7095..165202937e9538bec8ef4fb518981d750e586a0d 100644 (file)
--- a/vnc.c
+++ b/vnc.c
@@ -2438,6 +2438,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;