From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0iFp-0007Kq-Su for qemu-devel@nongnu.org; Thu, 13 Nov 2008 14:53:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0iFn-0007Js-VF for qemu-devel@nongnu.org; Thu, 13 Nov 2008 14:53:25 -0500 Received: from [199.232.76.173] (port=60555 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0iFn-0007Jl-Qf for qemu-devel@nongnu.org; Thu, 13 Nov 2008 14:53:23 -0500 Received: from qw-out-1920.google.com ([74.125.92.147]:29410) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0iFn-0000Gf-IV for qemu-devel@nongnu.org; Thu, 13 Nov 2008 14:53:23 -0500 Received: by qw-out-1920.google.com with SMTP id 5so821524qwc.4 for ; Thu, 13 Nov 2008 11:53:21 -0800 (PST) Message-ID: <491C85AE.70709@codemonkey.ws> Date: Thu, 13 Nov 2008 13:53:18 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Fix crash on 'info vnc' after 'change vnc none' References: <491B22AC.6050907@cisco.com> In-Reply-To: <491B22AC.6050907@cisco.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org James Ko wrote: > 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 > diff -aru a/qemu/vnc.c b/qemu/vnc.c > --- a/qemu/vnc.c 2008-08-21 17:46:40.000000000 -0700 > +++ b/qemu/vnc.c 2008-11-06 14:31:51.000000000 -0800 > @@ -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: "); > >