Skip to contentSkip to conversation

re-fix screendump

PATCH Applied Stefano Stabellini 2 participants 2 messages Jan 21, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 re-fix screendump

Removing the assumption about a single graphic console made get_graphic_console return NULL when called by vga_screen_dump. In this case returning NULL is correct but since NULL is not handled in qemu_console_resize it causes a segmentation fault.
Just returning immediately from qemu_console_resize is sufficient to fix the problem.

---

console.c +2 -0
index 6d0c1b3..9dcbac8 100644
@@ -1421,6 +1421,8 @@ void text_consoles_set_display(DisplayState *ds)
 void qemu_console_resize(DisplayState *ds, int width, int height)
 {
     TextConsole *s = get_graphic_console(ds);
+    if (!s) return;
+
     s->g_width = width;
     s->g_height = height;
     if (is_graphic_console()) {
#1 lore raw
Quoted 9 lines · Stefano Stabellini

Removing the assumption about a single graphic console made get_graphic_console return NULL when called by vga_screen_dump. In this case returning NULL is correct but since NULL is not handled in qemu_console_resize it causes a segmentation fault.
Just returning immediately from qemu_console_resize is sufficient to fix the problem.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 21 lines

---

console.c +2 -0
index 6d0c1b3..9dcbac8 100644
@@ -1421,6 +1421,8 @@ void text_consoles_set_display(DisplayState *ds)
 void qemu_console_resize(DisplayState *ds, int width, int height)
 {
     TextConsole *s = get_graphic_console(ds);
+    if (!s) return;
+
     s->g_width = width;
     s->g_height = height;
     if (is_graphic_console()) {