|
|
d25db3 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
d25db3 |
From: Victor Toso <me@victortoso.com>
|
|
|
d25db3 |
Date: Fri, 6 Apr 2018 09:59:44 +0200
|
|
|
d25db3 |
Subject: [PATCH] channel-usbredir: Fix crash on channel-up
|
|
|
d25db3 |
|
|
|
d25db3 |
By adding a guard to not handle channel-up on SpiceUsbredirChannel in
|
|
|
d25db3 |
case struct usbredirhost wasn't initialized yet. Same guard is in
|
|
|
d25db3 |
place for the generic usbredir_handle_msg() function to avoid handling
|
|
|
d25db3 |
Server's message while Client's initialization is not done.
|
|
|
d25db3 |
|
|
|
d25db3 |
As mentioned in commit 291f3e4419e6, this isn't a problem for
|
|
|
d25db3 |
graphical clients as some initialization is done to present the
|
|
|
d25db3 |
shareable usb devices to user.
|
|
|
d25db3 |
|
|
|
d25db3 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1399838
|
|
|
d25db3 |
Signed-off-by: Victor Toso <victortoso@redhat.com>
|
|
|
d25db3 |
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
|
|
|
d25db3 |
---
|
|
|
d25db3 |
src/channel-usbredir.c | 1 +
|
|
|
d25db3 |
1 file changed, 1 insertion(+)
|
|
|
d25db3 |
|
|
|
d25db3 |
diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
|
|
|
d25db3 |
index 1f791bc..306bdd5 100644
|
|
|
d25db3 |
--- a/src/channel-usbredir.c
|
|
|
d25db3 |
+++ b/src/channel-usbredir.c
|
|
|
d25db3 |
@@ -817,6 +817,7 @@ static void spice_usbredir_channel_up(SpiceChannel *c)
|
|
|
d25db3 |
SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(c);
|
|
|
d25db3 |
SpiceUsbredirChannelPrivate *priv = channel->priv;
|
|
|
d25db3 |
|
|
|
d25db3 |
+ g_return_if_fail(priv->host != NULL);
|
|
|
d25db3 |
/* Flush any pending writes */
|
|
|
d25db3 |
usbredirhost_write_guest_data(priv->host);
|
|
|
d25db3 |
}
|