Commit ecbaf03 for zlib
commit ecbaf031f81ddfcff200dcfd052df48c9047f3cf
Author: Mark Adler <git@madler.net>
Date: Sun Jan 11 09:46:29 2026 -0800
Zero inflate state on allocation.
To further guard against the propagation of uninitialized memory.
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 *)