1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Add a missing null pointer check in s_write.

I don't know that this can ever be triggered in the current state of
the code, but when I start mucking around with SSH session closing in
the near future, it may be handy to have it.

[originally from svn r10076]
This commit is contained in:
Simon Tatham 2013-11-17 14:04:56 +00:00
parent 8be6fbaa09
commit b71b443c7c

2
ssh.c
View File

@ -1762,6 +1762,8 @@ static int s_write(Ssh ssh, void *data, int len)
if (ssh->logctx)
log_packet(ssh->logctx, PKT_OUTGOING, -1, NULL, data, len,
0, NULL, NULL);
if (!ssh->s)
return 0;
return sk_write(ssh->s, (char *)data, len);
}