aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <git@madler.net>2026-02-21 23:03:37 -0800
committerMark Adler <git@madler.net>2026-02-21 23:07:18 -0800
commit09a1572aa624e5ddb6c075dc013880de70b1b9b9 (patch)
treedc5503dac9cfa06de6ce134fd2f719e66c1900d6
parent846a66a2806bab9e95a05971b2b32efea431d239 (diff)
downloadzlib-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.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/infback.c b/infback.c
index e6443feb..ac96ba10 100644
--- a/infback.c
+++ b/infback.c
@@ -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;