X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshzlib.c;h=25ccd259b2cd3b14d102691e09ac0990da671cd1;hb=0395e52bb8db4b77e792ea1c46b2c0024c67986b;hp=94f0b80c8207d4d2343dfe8ed4fac39b8f457473;hpb=2226098a9e171ac2434df91c848b1b286e2d481e;p=PuTTY.git diff --git a/sshzlib.c b/sshzlib.c index 94f0b80c..25ccd259 100644 --- a/sshzlib.c +++ b/sshzlib.c @@ -224,6 +224,7 @@ static void lz77_compress(struct LZ77Context *ctx, } st->npending -= i; + defermatch.distance = 0; /* appease compiler */ defermatch.len = 0; deferchr = '\0'; while (len > 0) { @@ -1258,6 +1259,8 @@ int zlib_decompress_block(void *handle, unsigned char *block, int len, goto finished; nlen = dctx->bits & 0xFFFF; EATBITS(16); + if (dctx->uncomplen != (nlen ^ 0xFFFF)) + goto decode_error; if (dctx->uncomplen == 0) dctx->state = OUTSIDEBLK; /* block is empty */ else @@ -1368,6 +1371,7 @@ int main(int argc, char **argv) const struct ssh_compress ssh_zlib = { "zlib", + "zlib@openssh.com", /* delayed version */ zlib_compress_init, zlib_compress_cleanup, zlib_compress_block,