[PATCH spice-server 2/2] server/red_channel: do not attempt to write if the channel client is disconnected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The red_channel_client_event call to red_channel_client_receive might result
in a disconnected channel client. The following call to
red_channel_client_push may call to red_peer_handle_outgoing with a
disconnected socket.
---
 server/red_channel.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/server/red_channel.c b/server/red_channel.c
index de50047..9a48e77 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -305,6 +305,10 @@ static void red_peer_handle_outgoing(RedsStream *stream, OutgoingHandler *handle
 {
     ssize_t n;
 
+    if (!stream) {
+        return;
+    }
+
     if (handler->size == 0) {
         handler->vec = handler->vec_buf;
         handler->size = handler->cb->get_msg_size(handler->opaque);
-- 
1.7.7.6

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]