diff options
| author | Mark Adler <git@madler.net> | 2026-02-21 23:03:37 -0800 |
|---|---|---|
| committer | Mark Adler <git@madler.net> | 2026-02-21 23:07:18 -0800 |
| commit | 09a1572aa624e5ddb6c075dc013880de70b1b9b9 (patch) | |
| tree | dc5503dac9cfa06de6ce134fd2f719e66c1900d6 | |
| parent | 846a66a2806bab9e95a05971b2b32efea431d239 (diff) | |
| download | zlib-09a1572aa624e5ddb6c075dc013880de70b1b9b9.tar.gz zlib-09a1572aa624e5ddb6c075dc013880de70b1b9b9.tar.bz2 zlib-09a1572aa624e5ddb6c075dc013880de70b1b9b9.zip | |
Fix inflateBack() bug that would fail to detect a too far back.
The bug would pass off an invalid deflate stream as good, and copy
uninitialized memory contents to the output.
| -rw-r--r-- | infback.c | 2 |
1 files changed, 0 insertions, 2 deletions
| @@ -423,8 +423,6 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc, | |||
| 423 | /* use inflate_fast() if we have enough input and output */ | 423 | /* use inflate_fast() if we have enough input and output */ |
| 424 | if (have >= 6 && left >= 258) { | 424 | if (have >= 6 && left >= 258) { |
| 425 | RESTORE(); | 425 | RESTORE(); |
| 426 | if (state->whave < state->wsize) | ||
| 427 | state->whave = state->wsize - left; | ||
| 428 | inflate_fast(strm, state->wsize); | 426 | inflate_fast(strm, state->wsize); |
| 429 | LOAD(); | 427 | LOAD(); |
| 430 | break; | 428 | break; |
