Skip to contentSkip to conversation

Fix crash on 'info vnc' after 'change vnc none'

PATCH Applied James Ko 3 participants 3 messages Nov 12, 2008 – Dec 13, 2008

lore
Share & tools
lore

James Ko

author
#0 lore raw

PATCH 1/1 Fix crash on 'info vnc' after 'change vnc none'

I propose the following patch to prevent crash in call to term_print_filename with NULL vnc_state->display argument from do_info_vnc.

vnc_state->display is set to NULL after "change vnc none" but vnc_state itself is still valid.

James

qemu/vnc.c 2008-11-06 14:31:51.000000000 -0800 renamed from qemu/vnc.c 2008-08-21 17:46:40.000000000 -0700 +1 -1
diff -aru a/qemu/vnc.c b/qemu/vnc.c
@@ -180,7 +180,7 @@
 
 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: ");
#1 lore raw
Quoted 7 lines · James Ko

I propose the following patch to prevent crash in call to term_print_filename with NULL vnc_state->display argument from do_info_vnc.

vnc_state->display is set to NULL after "change vnc none" but vnc_state itself is still valid.

James

Please include a Signed-off-by.

Regards,

Anthony Liguori

Quoted 14 lines

diff -aru a/qemu/vnc.c b/qemu/vnc.c

qemu/vnc.c 2008-11-06 14:31:51.000000000 -0800 renamed from qemu/vnc.c 2008-08-21 17:46:40.000000000 -0700 +1 -1
@@ -180,7 +180,7 @@
 
 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: ");
#2 lore raw
In reply to James Ko
Quoted 9 lines · James Ko

I propose the following patch to prevent crash in call to term_print_filename
with NULL vnc_state->display argument from do_info_vnc.

vnc_state->display is set to NULL after "change vnc none" but vnc_state itself
is still valid.

James

Thanks, applied.

Quoted 16 lines

diff -aru a/qemu/vnc.c b/qemu/vnc.c

qemu/vnc.c 2008-11-06 14:31:51.000000000 -0800 renamed from qemu/vnc.c 2008-08-21 17:46:40.000000000 -0700 +1 -1
@@ -180,7 +180,7 @@
 
 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: ");
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net