mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-28 15:24:49 -05:00
A couple of SSH2 fixes
[originally from svn r602]
This commit is contained in:
parent
0e67e1b291
commit
774110ee94
12
ssh.c
12
ssh.c
@ -454,10 +454,10 @@ next_packet:
|
||||
/*
|
||||
* Adjust memory allocation if packet is too big.
|
||||
*/
|
||||
if (pktin.maxlen < packetlen) {
|
||||
pktin.maxlen = packetlen;
|
||||
pktin.data = (pktin.data == NULL ? malloc(packetlen+APIEXTRA) :
|
||||
realloc(pktin.data, packetlen+APIEXTRA));
|
||||
if (pktin.maxlen < packetlen+maclen) {
|
||||
pktin.maxlen = packetlen+maclen;
|
||||
pktin.data = (pktin.data == NULL ? malloc(pktin.maxlen+APIEXTRA) :
|
||||
realloc(pktin.data, pktin.maxlen+APIEXTRA));
|
||||
if (!pktin.data)
|
||||
fatalbox("Out of memory");
|
||||
}
|
||||
@ -2171,8 +2171,8 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
|
||||
ssh2_pkt_init(SSH2_MSG_CHANNEL_OPEN);
|
||||
ssh2_pkt_addstring("session");
|
||||
ssh2_pkt_adduint32(100); /* as good as any */
|
||||
ssh2_pkt_adduint32(0xFFFFFFFFUL); /* very big window which we ignore */
|
||||
ssh2_pkt_adduint32(0xFFFFFFFFUL); /* very big max pkt size */
|
||||
ssh2_pkt_adduint32(0x7FFFFFFFUL); /* very big window which we ignore */
|
||||
ssh2_pkt_adduint32(0x7FFFFFFFUL); /* very big max pkt size */
|
||||
ssh2_pkt_send();
|
||||
crWaitUntilV(ispkt);
|
||||
if (pktin.type != SSH2_MSG_CHANNEL_OPEN_CONFIRMATION) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user