Skip to contentSkip to conversation

Fix segfault on screendump with -nographic

PATCH New Alexander Graf 1 participant 1 message May 28, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
console.c +1 -1
index 871c1d4..9c6addf 100644
@@ -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;
 }
Signature · 1 line
1.6.0.2