mirror of
https://github.com/madler/zlib.git
synced 2026-01-18 17:11:27 +01:00
Zero inflate state on allocation.
To further guard against the propagation of uninitialized memory.
This commit is contained in:
@@ -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 *)
|
||||
|
||||
Reference in New Issue
Block a user