diff options
| author | Simon Tatham <anakin@pobox.com> | 2014-10-01 18:36:33 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2014-10-01 18:36:33 +0000 |
| commit | 1d32c57442f6b72c69ebdac69a068da10fc195f0 (patch) | |
| tree | 20a06ac613dba40476bef77d10b1968eb5ec9f07 /deflate.c | |
| parent | 6c393e0b85658f39b2324346685f1bcdfa1012c1 (diff) | |
| download | halibut-1d32c57442f6b72c69ebdac69a068da10fc195f0.zip halibut-1d32c57442f6b72c69ebdac69a068da10fc195f0.tar.gz halibut-1d32c57442f6b72c69ebdac69a068da10fc195f0.tar.bz2 halibut-1d32c57442f6b72c69ebdac69a068da10fc195f0.tar.xz | |
Apply the same Deflate decoder fix as PuTTY r10278.
This causes sensible error reporting if distance codes 30 or 31 appear
in a compressed block.
(Not that Halibut actually _uses_ the Deflate decoder - it only uses
the encoder - but if I've got a copy of this code here then it should
be correct.)
[originally from svn r10280]
[r10278 == 3fd8014ea7235d0ec34e8f97a34f3ecf576e8239 in putty repository]
Diffstat (limited to 'deflate.c')
| -rw-r--r-- | deflate.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -2417,6 +2417,10 @@ int deflate_decompress_data(deflate_decompress_ctx *dctx, debug(("recv: dist %d\n", code)); if (code == -1) goto finished; + if (code >= 30) { + error = DEFLATE_ERR_BADDISTCODE; + goto finished; + } dctx->state = GOTDISTSYM; dctx->sym = code; break; |