]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/commitdiff
vnc: Fix crash on 'info vnc' after 'change vnc none'
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 13 Dec 2008 18:57:12 +0000 (18:57 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 13 Dec 2008 18:57:12 +0000 (18:57 +0000)
vnc_state->display is set to NULL after "change vnc none" but vnc_state itself
is still valid.

(James Ko)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6010 c046a42c-6fe2-441c-8c8c-71466251a162

vnc.c

diff --git a/vnc.c b/vnc.c
index 538658a774df9b636fb9b5ab189249080a331e84..3a7d76234a733c22271020dacc005d4ae3d11636 100644 (file)
--- a/vnc.c
+++ b/vnc.c
@@ -183,7 +183,7 @@ static VncState *vnc_state; /* needed for info vnc */
 
 void do_info_vnc(void)
 {
-    if (vnc_state == NULL)
+    if (vnc_state == NULL || vnc_state->display == NULL)
        term_printf("VNC server disabled\n");
     else {
        term_printf("VNC server active on: ");