* [Qemu-devel] [PATCH] re-fix screendump
@ 2009-01-21 18:54 Stefano Stabellini
2009-01-21 19:18 ` Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Stefano Stabellini @ 2009-01-21 18:54 UTC (permalink / raw)
To: qemu-devel
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.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
diff --git a/console.c b/console.c
index 6d0c1b3..9dcbac8 100644
--- a/console.c
+++ b/console.c
@@ -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()) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] re-fix screendump
2009-01-21 18:54 [Qemu-devel] [PATCH] re-fix screendump Stefano Stabellini
@ 2009-01-21 19:18 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2009-01-21 19:18 UTC (permalink / raw)
To: qemu-devel
Stefano Stabellini wrote:
> 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.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
>
> diff --git a/console.c b/console.c
> index 6d0c1b3..9dcbac8 100644
> --- a/console.c
> +++ b/console.c
> @@ -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()) {
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-21 19:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 18:54 [Qemu-devel] [PATCH] re-fix screendump Stefano Stabellini
2009-01-21 19:18 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).