From a6253970d63f1b9f3c9d31a9bc8cfab3cdd3be3f Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 11 Jan 2003 10:05:29 +0000 Subject: [PATCH] Yet _another_ `received data for nonexistent channel' bug. This time it was because we received WINDOW_ADJUST on a channel we'd already sent CLOSE on, and reflexively attempted to continue sending the buffered data in response. Should now be fixed. git-svn-id: svn://svn.tartarus.org/sgt/putty@2539 cda61777-01e9-0310-a592-d414129be87e --- ssh.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ssh.c b/ssh.c index c0f06efa..c52301eb 100644 --- a/ssh.c +++ b/ssh.c @@ -5589,8 +5589,8 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt) unsigned i = ssh2_pkt_getuint32(ssh); struct ssh_channel *c; c = find234(ssh->channels, &i, ssh_channelfind); - if (!c) - continue; /* nonexistent channel */ + if (!c || c->closes) + continue; /* nonexistent or closing channel */ c->v.v2.remwindow += ssh2_pkt_getuint32(ssh); s->try_send = TRUE; } else if (ssh->pktin.type == SSH2_MSG_CHANNEL_OPEN_CONFIRMATION) { @@ -5811,7 +5811,10 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt) * Try to send data on all channels if we can. */ for (i = 0; NULL != (c = index234(ssh->channels, i)); i++) { - int bufsize = ssh2_try_send(c); + int bufsize; + if (c->closes) + continue; /* don't send on closing channels */ + bufsize = ssh2_try_send(c); if (bufsize == 0) { switch (c->type) { case CHAN_MAINSESSION: -- 2.11.0