[Spice-devel] [ALREADY PUSHED my bad 3/6] server/red_channel: avoid segfault if stream == NULL

Alon Levy alevy at redhat.com
Mon Jan 23 04:21:14 PST 2012


---
 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 e526179..d2c9e6d 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -162,6 +162,10 @@ static void red_peer_handle_incoming(RedsStream *stream, IncomingHandler *handle
     uint16_t msg_type;
     uint32_t msg_size;
 
+    if (!stream) {
+        return;
+    }
+
     for (;;) {
         int ret_handle;
         if (handler->header_pos < handler->header.header_size) {
-- 
1.7.8.4



More information about the Spice-devel mailing list