From 68370a6aeeeaa1f52d809f2d452feec968c0d550 Mon Sep 17 00:00:00 2001 From: tbeu Date: Wed, 28 Aug 2024 22:49:48 +0200 Subject: [PATCH] Set lencode and distcode symmetrically As reported by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70617 and https://github.com/madler/zlib/issues/997 --- inflate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inflate.c b/inflate.c index e2fa6bb1a..4feac091e 100644 --- a/inflate.c +++ b/inflate.c @@ -923,7 +923,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) { while (state->have < 19) state->lens[order[state->have++]] = 0; state->next = state->codes; - state->lencode = (const code FAR *)(state->next); + state->lencode = state->distcode = (const code FAR *)(state->next); state->lenbits = 7; ret = inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work);