1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix null dereference in ssh_unthrottle.

The backend_unthrottle function gets called when the backlog on stdout
clears, and it's possible for that to happen _after_ the SSH backend
has terminated the connection and freed all its protocol modules (e.g.
if a protocol error occurred on the network while data was still
waiting to be written to stdout). So ssh_unthrottle should check that
ssh->cl still exists before calling any method of it.
This commit is contained in:
Simon Tatham 2019-01-29 20:31:47 +00:00
parent 0212b9e5e5
commit a5911f76d0

3
ssh.c
View File

@ -1013,7 +1013,8 @@ static void ssh_unthrottle(Backend *be, int bufsize)
{
Ssh *ssh = container_of(be, Ssh, backend);
ssh_stdout_unthrottle(ssh->cl, bufsize);
if (ssh->cl)
ssh_stdout_unthrottle(ssh->cl, bufsize);
}
static bool ssh_connected(Backend *be)