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

Be more careful of bombouts at the s_rdpkt level: if these happen

(for example SSH_MSG_DISCONNECT) we should avoid even calling
ssh_protocol.

[originally from svn r1259]
This commit is contained in:
Simon Tatham 2001-09-09 14:47:29 +00:00
parent e48610f8bc
commit 7bb4a9f5f0

5
ssh.c
View File

@ -726,6 +726,7 @@ static int ssh1_rdpkt(unsigned char **data, int *datalen)
buf[nowlen + msglen] = '\0';
logevent(buf);
bombout(("Server sent disconnect message:\n\"%s\"", buf+nowlen));
crReturn(0);
}
crFinish(0);
@ -904,6 +905,7 @@ static int ssh2_rdpkt(unsigned char **data, int *datalen)
(reason > 0 && reason < lenof(ssh2_disconnect_reasons)) ?
ssh2_disconnect_reasons[reason] : "unknown",
buf+nowlen));
crReturn(0);
}
crFinish(0);
@ -1600,6 +1602,9 @@ static void ssh_gotdata(unsigned char *data, int datalen)
while (1) {
while (datalen > 0) {
if (s_rdpkt(&data, &datalen) == 0) {
if (ssh_state == SSH_STATE_CLOSED) {
return;
}
ssh_protocol(NULL, 0, 1);
if (ssh_state == SSH_STATE_CLOSED) {
return;