From 7ace008f969df177efa9e6abc7437e2ac1ea2e50 Mon Sep 17 00:00:00 2001 From: Suzy Wang Date: Mon, 6 Jun 2022 13:04:13 -0700 Subject: [PATCH] Zlib patch: prevent uninitialized use of state->check --- inflate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inflate.c b/inflate.c index 5777dbb7e7..03d92b43a5 100644 --- a/inflate.c +++ b/inflate.c @@ -1295,6 +1295,8 @@ int32_t Z_EXPORT PREFIX(inflateSync)(PREFIX3(stream) *strm) { /* return no joy or set up to restart inflate() on a new block */ if (state->have != 4) return Z_DATA_ERROR; + if (state->mode == HEAD) + state->wrap = 0; if (state->flags == -1) state->wrap = 0; /* if no header yet, treat as raw */ else