Tong Ho points out a missing ssh_pkt_ensure().
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 30 Jun 2007 18:17:12 +0000 (18:17 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 30 Jun 2007 18:17:12 +0000 (18:17 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@7626 cda61777-01e9-0310-a592-d414129be87e

ssh.c

diff --git a/ssh.c b/ssh.c
index 21fcd2d..809f4af 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -1424,6 +1424,7 @@ static int s_wrpkt_prepare(Ssh ssh, struct Packet *pkt, int *offset_p)
        zlib_compress_block(ssh->cs_comp_ctx,
                            pkt->data + 12, pkt->length - 12,
                            &compblk, &complen);
+       ssh_pkt_ensure(pkt, complen + 2);   /* just in case it's got bigger */
        memcpy(pkt->data + 12, compblk, complen);
        sfree(compblk);
        pkt->length = complen + 12;