From 52d014d62b1f97a896f130cbc2ddc1d07c85b035 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 28 Oct 2011 10:56:19 +0200 Subject: [PATCH 02/11] Fix segfault on screendump with -nographic RH-Author: Gerd Hoffmann Message-id: <1319799379-12075-1-git-send-email-kraxel@redhat.com> Patchwork-id: 34726 O-Subject: [RHEL-6.3 qemu-kvm PATCH] Fix segfault on screendump with -nographic Bugzilla: 728385 RH-Acked-by: Paolo Bonzini RH-Acked-by: Markus Armbruster RH-Acked-by: Hans de Goede From: Alexander Graf 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 (cherry picked from commit e34b12ae98b6851da8acc791d6df05f4482ae416) bugzilla: 728385 - attempting to take a screenshot of a VM with no graphics crashes qemu Signed-off-by: Gerd Hoffmann --- console.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Signed-off-by: Michal Novotny --- console.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/console.c b/console.c index 358d748..eec4a47 100644 --- a/console.c +++ b/console.c @@ -178,7 +178,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.7.7.3