]> 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)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 28 Aug 2009 02:23:39 +0000 (21:23 -0500)
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc.c

diff --git a/vnc.c b/vnc.c
index a50ee0c1ef5c3b20cf9ae7af462fdf396e59e2a0..d79dfd9a3a48129b7534ebe172cb3af6cf13ac9a 100644 (file)
--- a/vnc.c
+++ b/vnc.c
@@ -2182,6 +2182,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;