From: Gerd Hoffmann Date: Thu, 20 May 2010 13:23:06 +0000 (+0200) Subject: check for active_console before using it X-Git-Tag: v0.13.0-rc0~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26572b8a0e90ee0c77587173a78fa293a1d2beb6;p=thirdparty%2Fqemu.git check for active_console before using it Other vga_hw_* functions do the same. Fixes a segmentation fault. Trigger: boot with -nodefaults, then connect via vnc. Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- diff --git a/console.c b/console.c index 7070b1b1ade..4c42b2810c1 100644 --- a/console.c +++ b/console.c @@ -167,7 +167,7 @@ void vga_hw_update(void) void vga_hw_invalidate(void) { - if (active_console->hw_invalidate) + if (active_console && active_console->hw_invalidate) active_console->hw_invalidate(active_console->hw); }