Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBZhV-0002Zf-53 for qemu-devel@nongnu.org; Sat, 13 Dec 2008 13:58:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBZhU-0002ZA-JX for qemu-devel@nongnu.org; Sat, 13 Dec 2008 13:58:52 -0500 Received: from [199.232.76.173] (port=48557 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBZhU-0002Z1-7g for qemu-devel@nongnu.org; Sat, 13 Dec 2008 13:58:52 -0500 Received: from hall.aurel32.net ([88.191.82.174]:46326) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LBZhT-0003jX-OQ for qemu-devel@nongnu.org; Sat, 13 Dec 2008 13:58:52 -0500 Received: from aurel32 by hall.aurel32.net with local (Exim 4.63) (envelope-from ) id 1LBZhS-0006E3-EK for qemu-devel@nongnu.org; Sat, 13 Dec 2008 19:58:50 +0100 Date: Sat, 13 Dec 2008 19:58:50 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Fix crash on 'info vnc' after 'change vnc none' Message-ID: <20081213185850.GC22069@hall.aurel32.net> References: <491B22AC.6050907@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <491B22AC.6050907@cisco.com> Sender: Aurelien Jarno 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 On Wed, Nov 12, 2008 at 10:38:36AM -0800, 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 Thanks, applied. > > 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: "); > > > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net