diff options
author | Marc-André Lureau | 2017-04-06 14:05:11 +0200 |
---|---|---|
committer | Gerd Hoffmann | 2017-04-24 10:12:28 +0200 |
commit | 6905b93447a42e606dfd126b90f75f4cd3c6fe94 (patch) | |
tree | df73263fb239fbb502b0ae7730da3b72abc751df | |
parent | Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170421' i... (diff) | |
download | qemu-6905b93447a42e606dfd126b90f75f4cd3c6fe94.tar.gz qemu-6905b93447a42e606dfd126b90f75f4cd3c6fe94.tar.xz qemu-6905b93447a42e606dfd126b90f75f4cd3c6fe94.zip |
console: add same surface replace pre-condition
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>
Message-id: 20170406120513.638-2-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | ui/console.c | 2 |
1 files changed, 2 insertions, 0 deletions
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)) { |