Received: from eggs.gnu.org ([140.186.70.92]:47385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSSU8-0001l3-ML for qemu-devel@nongnu.org; Fri, 03 Jun 2011 07:24:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QSSU5-0006Dj-9l for qemu-devel@nongnu.org; Fri, 03 Jun 2011 07:24:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35910 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QSSU4-0006Cl-Hp for qemu-devel@nongnu.org; Fri, 03 Jun 2011 07:24:08 -0400 From: Alexander Graf Date: Thu, 2 Jun 2011 08:33:02 +0200 Message-Id: <1306996383-27950-5-git-send-email-agraf@suse.de> In-Reply-To: <1306996383-27950-1-git-send-email-agraf@suse.de> References: <1306996383-27950-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 4/5] Fix segfault on screendump with -nographic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org Developers" Cc: Aurelien Jarno 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