提交 33bcd98c 编写于 作者: A Alexander Graf

console: Fix segfault on screendump without VGA adapter

When trying to create a screen dump without having any VGA adapter
inside the guest, QEMU segfaults.

This is because it's trying to switch back to the "previous" screen
it was on before dumping the VGA screen. Unfortunately, in my case
there simply is no previous screen so it accesses a NULL pointer.

Fix it by checking if previous_active_console is actually available.

This is 1.0 material.
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 4e9200a0
......@@ -186,7 +186,9 @@ void vga_hw_screen_dump(const char *filename)
consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
}
console_select(previous_active_console->index);
if (previous_active_console) {
console_select(previous_active_console->index);
}
}
void vga_hw_text_update(console_ch_t *chardata)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册