Skip to content

Commit

Permalink
Add some extra validation to zlib decompression (primarily to shut up…
Browse files Browse the repository at this point in the history
… a GCC 4.6

warning).


git-svn-id: svn://svn.tartarus.org/sgt/putty@9113 cda61777-01e9-0310-a592-d414129be87e
  • Loading branch information
jacob committed Mar 1, 2011
1 parent a8375a4 commit 354562c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sshzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,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
Expand Down

0 comments on commit 354562c

Please sign in to comment.