Commit 972a61db authored by Victor Toso's avatar Victor Toso
Browse files

channel-usbredir: Fix crash on channel-up

By adding a guard to not handle channel-up on SpiceUsbredirChannel in
case struct usbredirhost wasn't initialized yet. Same guard is in
place for the generic usbredir_handle_msg() function to avoid handling
Server's message while Client's initialization is not done.

As mentioned in commit 291f3e44, this isn't a problem for
graphical clients as some initialization is done to present the
shareable usb devices to user.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1399838

Signed-off-by: Victor Toso's avatarVictor Toso <victortoso@redhat.com>
Acked-by: Christophe Fergeau's avatarChristophe Fergeau <cfergeau@redhat.com>
parent 139f84da
Pipeline #899 passed with stage
in 8 minutes and 38 seconds
......@@ -817,6 +817,7 @@ static void spice_usbredir_channel_up(SpiceChannel *c)
SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(c);
SpiceUsbredirChannelPrivate *priv = channel->priv;
g_return_if_fail(priv->host != NULL);
/* Flush any pending writes */
usbredirhost_write_guest_data(priv->host);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment