commit 13c742529cbadeeaa6e8a71e4c3bc5e329327941
Author: Oswald Buddenhagen <[email protected]>
Date:   Sat Feb 14 14:03:41 2015 +0100

    fix crash on shutdown of compressed connection
    
    the callback may destroy the socket, so it is very unwise to use it for
    buffering the return value. use a temporary instead.

 src/socket.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/socket.c b/src/socket.c
index 3c4a3cd..d70488a 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -627,11 +627,13 @@ socket_fill( conn_t *sock )
 {
 #ifdef HAVE_LIBZ
        if (sock->in_z) {
+               int ret;
                /* The timer will preempt reads until the buffer is empty. */
                assert( !sock->in_z->avail_in );
                sock->in_z->next_in = (uchar *)sock->z_buf;
-               if ((sock->in_z->avail_in = do_read( sock, sock->z_buf, 
sizeof(sock->z_buf) )) <= 0)
+               if ((ret = do_read( sock, sock->z_buf, sizeof(sock->z_buf) )) 
<= 0)
                        return;
+               sock->in_z->avail_in = ret;
                socket_fill_z( sock );
        } else
 #endif

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to