Skip to content

Commit

Permalink
spice: init dcl before registering qxl interface
Browse files Browse the repository at this point in the history
Without this spice might callback into qemu before ssd->dcl.con is
initialized, resulting in a segfault due to NULL pointer dereference.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
  • Loading branch information
kraxel committed Feb 23, 2016
1 parent 8eb779e commit b5e751b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/spice-display.c
Expand Up @@ -775,14 +775,14 @@ static void qemu_spice_display_init_one(QemuConsole *con)

qemu_spice_display_init_common(ssd);

ssd->dcl.ops = &display_listener_ops;
ssd->dcl.con = con;

ssd->qxl.base.sif = &dpy_interface.base;
qemu_spice_add_display_interface(&ssd->qxl, con);
assert(ssd->worker);

qemu_spice_create_host_memslot(ssd);

ssd->dcl.ops = &display_listener_ops;
ssd->dcl.con = con;
register_displaychangelistener(&ssd->dcl);
}

Expand Down

0 comments on commit b5e751b

Please sign in to comment.