All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] re-fix screendump
Date: Wed, 21 Jan 2009 18:54:00 +0000	[thread overview]
Message-ID: <49776F48.2010001@eu.citrix.com> (raw)

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()) {

             reply	other threads:[~2009-01-21 18:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 18:54 Stefano Stabellini [this message]
2009-01-21 19:18 ` [Qemu-devel] [PATCH] re-fix screendump Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49776F48.2010001@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.