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

Fix crash when disconnecting in verstring phase.

If we disconnect because the two ends' SSH protocol versions don't
match, ssh_initiate_connection_close triggers a call to the BPP's
handle_output method, and sshverstring's one of those unconditionally
fails an assertion on the basis that nobody should be trying to send
SSH packets at that stage of the connection. In fact this call to
handle_output is only precautionary, and it's unproblematic because
there aren't any packets on the output queue. So the assertion is now
conditional on there actually being an erroneous packet.
This commit is contained in:
Simon Tatham 2018-10-07 20:37:30 +01:00
parent 2ea356c46c
commit e3e434537d

View File

@ -409,8 +409,10 @@ static PktOut *ssh_verstring_new_pktout(int type)
static void ssh_verstring_handle_output(BinaryPacketProtocol *bpp)
{
assert(0 && "Should never try to send packets during SSH version "
"string exchange");
if (pq_peek(&bpp->out_pq)) {
assert(0 && "Should never try to send packets during SSH version "
"string exchange");
}
}
/*