From ecbaf031f81ddfcff200dcfd052df48c9047f3cf Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sun, 11 Jan 2026 09:46:29 -0800 Subject: Zero inflate state on allocation. To further guard against the propagation of uninitialized memory. --- inflate.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'inflate.c') diff --git a/inflate.c b/inflate.c index 623c95b..f55949e 100644 --- a/inflate.c +++ b/inflate.c @@ -197,6 +197,7 @@ int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, state = (struct inflate_state FAR *) ZALLOC(strm, 1, sizeof(struct inflate_state)); if (state == Z_NULL) return Z_MEM_ERROR; + zmemzero(state, sizeof(struct inflate_state)); Tracev((stderr, "inflate: allocated\n")); strm->state = (struct internal_state FAR *)state; state->strm = strm; @@ -1338,6 +1339,7 @@ int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) { copy = (struct inflate_state FAR *) ZALLOC(source, 1, sizeof(struct inflate_state)); if (copy == Z_NULL) return Z_MEM_ERROR; + zmemzero(copy, sizeof(struct inflate_state)); window = Z_NULL; if (state->window != Z_NULL) { window = (unsigned char FAR *) -- cgit v1.2.3-55-g6feb