From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ7LB-0003A0-5G for qemu-devel@nongnu.org; Fri, 27 May 2011 20:25:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQ7LA-0008HB-HJ for qemu-devel@nongnu.org; Fri, 27 May 2011 20:25:17 -0400 Received: from cantor.suse.de ([195.135.220.2]:37573 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQ7LA-0008H5-Ci for qemu-devel@nongnu.org; Fri, 27 May 2011 20:25:16 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id F2A0194033 for ; Sat, 28 May 2011 02:25:15 +0200 (CEST) From: Alexander Graf Date: Thu, 26 May 2011 21:56:22 +0200 Message-Id: <1306439782-25277-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] Fix segfault on screendump with -nographic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org Developers" When running -nographic and calling "screendump" on the monitor, qemu segfaults. Fix the invalid pointer dereference by checking for NULL. Signed-off-by: Alexander Graf --- console.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/console.c b/console.c index 871c1d4..9c6addf 100644 --- a/console.c +++ b/console.c @@ -180,7 +180,7 @@ void vga_hw_screen_dump(const char *filename) active_console = consoles[0]; /* There is currently no way of specifying which screen we want to dump, so always dump the first one. */ - if (consoles[0]->hw_screen_dump) + if (consoles[0] && consoles[0]->hw_screen_dump) consoles[0]->hw_screen_dump(consoles[0]->hw, filename); active_console = previous_active_console; } -- 1.6.0.2