From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPiHN-0007TN-4W for qemu-devel@nongnu.org; Wed, 21 Jan 2009 13:58:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPiHL-0007Qj-Jj for qemu-devel@nongnu.org; Wed, 21 Jan 2009 13:58:20 -0500 Received: from [199.232.76.173] (port=46691 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPiHL-0007QK-07 for qemu-devel@nongnu.org; Wed, 21 Jan 2009 13:58:19 -0500 Received: from smtp.ctxuk.citrix.com ([62.200.22.115]:43527 helo=SMTP.EU.CITRIX.COM) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPiHK-0008Sv-IN for qemu-devel@nongnu.org; Wed, 21 Jan 2009 13:58:18 -0500 Message-ID: <49776F48.2010001@eu.citrix.com> Date: Wed, 21 Jan 2009 18:54:00 +0000 From: Stefano Stabellini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] re-fix screendump 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 Removing the assumption about a single graphic console made get_graphic_console return NULL when called by vga_screen_dump. In this case returning NULL is correct but since NULL is not handled in qemu_console_resize it causes a segmentation fault. Just returning immediately from qemu_console_resize is sufficient to fix the problem. Signed-off-by: Stefano Stabellini --- diff --git a/console.c b/console.c index 6d0c1b3..9dcbac8 100644 --- a/console.c +++ b/console.c @@ -1421,6 +1421,8 @@ void text_consoles_set_display(DisplayState *ds) void qemu_console_resize(DisplayState *ds, int width, int height) { TextConsole *s = get_graphic_console(ds); + if (!s) return; + s->g_width = width; s->g_height = height; if (is_graphic_console()) {