From e14d0f19126c0fb1cf9ee3cdb7d69f9f3d42c035 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 9 Sep 2001 14:47:29 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@1259 cda61777-01e9-0310-a592-d414129be87e --- ssh.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ssh.c b/ssh.c index 23cfdaac..27b7216d 100644 --- a/ssh.c +++ b/ssh.c @@ -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; -- 2.11.0