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

Fix a crash when connection-sharing during userauth.

If a sharing downstream disconnected while we were still in userauth
(probably by deliberate user action, since such a downstream would
have just been sitting there waiting for upstream to be ready for it)
then we could crash by attempting to count234(ssh->channels) before
the ssh->channels tree had been set up in the first place.

A simple null-pointer check fixes it. Thanks to Antti Seppanen for the
report.
This commit is contained in:
Simon Tatham 2015-06-22 19:37:27 +01:00
parent 06946b4d4b
commit 31ff9e0f96

2
ssh.c
View File

@ -7613,7 +7613,7 @@ static void ssh_check_termination(Ssh ssh)
{
if (ssh->version == 2 &&
!conf_get_int(ssh->conf, CONF_ssh_no_shell) &&
count234(ssh->channels) == 0 &&
(ssh->channels && count234(ssh->channels) == 0) &&
!(ssh->connshare && share_ndownstreams(ssh->connshare) > 0)) {
/*
* We used to send SSH_MSG_DISCONNECT here, because I'd