1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 12:02:47 -05:00

Fix stale-pointer bugs in connection-fatal network errors.

I think these began to appear as a consequencce of replacing
fatalbox() calls with more sensible error reports: the more specific a
direction I send a report in, the greater the annoying possibility of
re-entrance when the resulting error handler starts closing stuff.
This commit is contained in:
Simon Tatham
2017-11-26 19:59:27 +00:00
parent 3e24bb610d
commit 57ceac8f1d
2 changed files with 5 additions and 1 deletions

2
ssh.c
View File

@ -7784,6 +7784,8 @@ static int ssh2_try_send(struct ssh_channel *c)
ssh2_pkt_addstring_start(pktout);
ssh2_pkt_addstring_data(pktout, data, len);
ssh2_pkt_send(ssh, pktout);
if (!ssh->s) /* a network error might have closed the socket */
break;
bufchain_consume(&c->v.v2.outbuffer, len);
c->v.v2.remwindow -= len;
}