channel-usbredir: Fix crash on channel-up
SpiceSession does not initialize its SpiceUsbDeviceManager object on startup that could lead to a race condition where channel-usbredir is requested to flush data while it is uninitialized. In a few places, spice_usb_device_manager_get() is called as in usb-device-widget.c and spice-gtk-session.c but not used in spicy-stats, making the tool to crash on startup if it encounters an usbredir channel. #0 in usbredirhost_write_guest_data (host=0x0) at usbredir/usbredirhost/usbredirhost.c:876 #1 in spice_usbredir_channel_up (c=0x643830) at channel-usbredir.c:821 #2 in spice_channel_up (channel=0x643830) at spice-channel.c:1238 #3 in spice_channel_recv_auth (channel=0x643830) at spice-channel.c:1225 #4 in spice_channel_coroutine (data=0x643830) at spice-channel.c:2580 #5 in coroutine_trampoline (cc=0x642ec0) at coroutine_ucontext.c:63 #6 in continuation_trampoline (i0=6565568, i1=0) at continuation.c:55 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1399838 Signed-off-by: Victor Toso <victortoso@redhat.com> Reported-by: Michael Cullen <michael@cullen-online.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Loading