[Spice-commits] server/cursor-channel.c server/stream-channel.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 7 14:59:03 UTC 2020


 server/cursor-channel.c |    4 +++-
 server/stream-channel.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 1ce119009aff6d11aceeff0696a664883bb62fc4
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Jan 21 15:45:42 2020 +0000

    Do not crash if channel clients cannot be created
    
    Channel client creation can fail in some situation.
    For instance if during a migration the client is disconnected.
    In most cases this is ignored (this is usually logged in
    red_channel_client_initable_init) but not in case of
    CursorChannelClient and StreamChannelClient.
    
    This fixes rhbz#1788757.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Julien Rope <jrope at redhat.com>

diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index fa2ddf83..138a0bd6 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -348,7 +348,9 @@ cursor_channel_connect(CursorChannel *cursor, RedClient *client, RedStream *stre
     ccc = cursor_channel_client_new(cursor, client, stream,
                                     migrate,
                                     caps);
-    spice_return_if_fail(ccc != NULL);
+    if (ccc == NULL) {
+        return;
+    }
 
     RedChannelClient *rcc = RED_CHANNEL_CLIENT(ccc);
     red_channel_client_ack_zero_messages_window(rcc);
diff --git a/server/stream-channel.c b/server/stream-channel.c
index 9841ff66..1d71c126 100644
--- a/server/stream-channel.c
+++ b/server/stream-channel.c
@@ -441,7 +441,9 @@ stream_channel_connect(RedChannel *red_channel, RedClient *red_client, RedStream
     spice_return_if_fail(stream != NULL);
 
     client = stream_channel_client_new(channel, red_client, stream, migration, caps);
-    spice_return_if_fail(client != NULL);
+    if (client == NULL) {
+        return;
+    }
 
     // request new stream
     start->num_codecs = stream_channel_get_supported_codecs(channel, start->codecs);


More information about the Spice-commits mailing list