]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Don't try sending on sharing channels.
authorSimon Tatham <anakin@pobox.com>
Sun, 7 Jun 2015 20:14:09 +0000 (21:14 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 7 Jun 2015 20:25:35 +0000 (21:25 +0100)
The final main loop in do_ssh2_authconn will sometimes loop over all
currently open channels calling ssh2_try_send_and_unthrottle. If the
channel is a sharing one, however, that will reference fields of the
channel structure like 'remwindow', which were never initialised in
the first place (thanks, valgrind). Fix by excluding CHAN_SHARING
channels from that loop.

ssh.c

diff --git a/ssh.c b/ssh.c
index c565059689c531d95b0404c1488a39bcb1161827..4da449c259f77185306fdd303c37baf3e06c1608 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -10524,7 +10524,8 @@ static void do_ssh2_authconn(Ssh ssh, const unsigned char *in, int inlen,
             * Try to send data on all channels if we can.
             */
            for (i = 0; NULL != (c = index234(ssh->channels, i)); i++)
-               ssh2_try_send_and_unthrottle(ssh, c);
+                if (c->type != CHAN_SHARING)
+                    ssh2_try_send_and_unthrottle(ssh, c);
        }
     }