From: Alexander Graf Date: Thu, 26 May 2011 21:50:33 +0000 (+0200) Subject: Fix segfault on screendump with -nographic X-Git-Tag: v0.15.0-rc0~226^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e34b12ae98b6851da8acc791d6df05f4482ae416;p=thirdparty%2Fqemu.git Fix segfault on screendump with -nographic 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 --- diff --git a/console.c b/console.c index 871c1d47b2d..9c6addf8e44 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; }