From 59dcd2a804f59b9151763e23426120e537ec127c Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 20 Sep 2000 10:59:24 +0000 Subject: [PATCH] A couple of SSH2 fixes git-svn-id: svn://svn.tartarus.org/sgt/putty@602 cda61777-01e9-0310-a592-d414129be87e --- ssh.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ssh.c b/ssh.c index 444f277a..10ec20b9 100644 --- a/ssh.c +++ b/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) { -- 2.11.0