qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com, dgilbert@redhat.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH 1/3] console: add same surface replace pre-condition
Date: Thu,  6 Apr 2017 14:05:11 +0200	[thread overview]
Message-ID: <20170406120513.638-2-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20170406120513.638-1-marcandre.lureau@redhat.com>

Catch an invalid state early, before a potential use-after-free. This is
mainly useful for documentation purposes.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/console.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ui/console.c b/ui/console.c
index 419b098c11..0cbe5033dd 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1538,6 +1538,8 @@ void dpy_gfx_replace_surface(QemuConsole *con,
     DisplaySurface *old_surface = con->surface;
     DisplayChangeListener *dcl;
 
+    assert(old_surface != surface);
+
     con->surface = surface;
     QLIST_FOREACH(dcl, &s->listeners, next) {
         if (con != (dcl->con ? dcl->con : active_console)) {
-- 
2.12.0.191.gc5d8de91d

  reply	other threads:[~2017-04-06 12:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 12:05 [Qemu-devel] [PATCH 0/3] Fix incoming migration regression of QXL in VGA mode Marc-André Lureau
2017-04-06 12:05 ` Marc-André Lureau [this message]
2017-04-06 12:05 ` [Qemu-devel] [PATCH 2/3] console: add same displaychangelistener registration pre-condition Marc-André Lureau
2017-04-06 12:05 ` [Qemu-devel] [PATCH 3/3] qxl: switch display on entering VGA Marc-André Lureau
2017-04-07 10:30 ` [Qemu-devel] [PATCH 0/3] Fix incoming migration regression of QXL in VGA mode Gerd Hoffmann

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=20170406120513.638-2-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=kraxel@redhat.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 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).