mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
Remember to wait for SSH1_MSG_SUCCESS after enabling remote port
forwardings in SSH1. Was causing several MSG_SUCCESS to be queued up unread, which was wrong-but-benign in most cases but caused a hard crash with compression enabled (one of those uncompressed MSG_SUCCESSes was fed to the zlib decompressor with spectacular results). [originally from svn r1609]
This commit is contained in:
parent
e40f043ff8
commit
17af65c78c
15
ssh.c
15
ssh.c
@ -2831,7 +2831,8 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt)
|
||||
}
|
||||
|
||||
{
|
||||
char type, *e;
|
||||
char type;
|
||||
static char *e;
|
||||
int n;
|
||||
int sport,dport,sserv,dserv;
|
||||
char sports[256], dports[256], host[256];
|
||||
@ -2924,6 +2925,18 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt)
|
||||
PKT_STR, host,
|
||||
PKT_INT, dport,
|
||||
PKT_END);
|
||||
do {
|
||||
crReturnV;
|
||||
} while (!ispkt);
|
||||
if (pktin.type != SSH1_SMSG_SUCCESS
|
||||
&& pktin.type != SSH1_SMSG_FAILURE) {
|
||||
bombout(("Protocol confusion"));
|
||||
crReturnV;
|
||||
} else if (pktin.type == SSH1_SMSG_FAILURE) {
|
||||
c_write_str("Server refused port forwarding\r\n");
|
||||
ssh_editing = ssh_echoing = 1;
|
||||
}
|
||||
logevent("Remote port forwarding enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user