From 7b4fa1b4c762a5fc20f905221c17b1698338c62a Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 8 Aug 2002 17:03:58 +0000 Subject: [PATCH] ssh.com 3.2.0 uses zlib sync flush (start and close an empty uncompressed block at the end of each compressed packet) which we were embarrassingly unable to deal with because we assumed every uncompressed block contained at least one byte. Particularly silly because I _knew_ about the existence of sync flush when I coded this module. Arrgh. Still, now fixed. git-svn-id: svn://svn.tartarus.org/sgt/putty@1824 cda61777-01e9-0310-a592-d414129be87e --- sshzlib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sshzlib.c b/sshzlib.c index dc23f5cc..91b29a0e 100644 --- a/sshzlib.c +++ b/sshzlib.c @@ -1164,7 +1164,10 @@ int zlib_decompress_block(unsigned char *block, int len, goto finished; nlen = dctx.bits & 0xFFFF; EATBITS(16); - dctx.state = UNCOMP_DATA; + if (dctx.uncomplen == 0) + dctx.state = OUTSIDEBLK; /* block is empty */ + else + dctx.state = UNCOMP_DATA; break; case UNCOMP_DATA: if (dctx.nbits < 8) -- 2.11.0