Fix crash if the SSH server disconnects.

When ssh_remote_error returns, the ssh2_transport_state has been
freed, so we shouldn't try to reach into it to pop its in_pq.
This commit is contained in:
Simon Tatham 2019-03-10 17:21:30 +00:00
Родитель a1ce240cfb
Коммит 58fd58d64c
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -347,7 +347,7 @@ bool ssh2_common_filter_queue(PacketProtocolLayer *ppl)
((reason > 0 && reason < lenof(ssh2_disconnect_reasons)) ?
ssh2_disconnect_reasons[reason] : "unknown"),
PTRLEN_PRINTF(msg));
pq_pop(ppl->in_pq);
/* don't try to pop the queue, because we've been freed! */
return true; /* indicate that we've been freed */
case SSH2_MSG_DEBUG: