]> 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>
Sat, 20 Jun 2015 11:47:42 +0000 (12:47 +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.

(cherry picked from commit 7366fde1d4831dcc701bc31e9de1113636fba1c5)

ssh.c

diff --git a/ssh.c b/ssh.c
index 059b6522cec0f022536f510bd77637d62e812a7a..dd9696225bdf79e98b2b16bd57130f944395cc83 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -10325,7 +10325,8 @@ static void do_ssh2_authconn(Ssh ssh, 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);
        }
     }