From 7366fde1d4831dcc701bc31e9de1113636fba1c5 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 7 Jun 2015 21:14:09 +0100 Subject: [PATCH] Don't try sending on sharing channels. 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ssh.c b/ssh.c index c5650596..4da449c2 100644 --- 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); } }