Commit 10ce9358 authored by Alexander Alekhin's avatar Alexander Alekhin

3rdparty(zlib): prevent uninitialized use of state->check

backporting of commit: 8afb2f0c
parent 7d3d6bc4
......@@ -228,6 +228,7 @@ int stream_size;
state->strm = strm;
state->window = Z_NULL;
state->mode = HEAD; /* to pass state test in inflateReset2() */
state->check = 1L; /* 1L is the result of adler32() zero length data */
ret = inflateReset2(strm, windowBits);
if (ret != Z_OK) {
ZFREE(strm, state);
......
diff --git a/3rdparty/zlib/inflate.c b/3rdparty/zlib/inflate.c
index ac333e8c2e..19a2cf2ed8 100644
--- a/3rdparty/zlib/inflate.c
+++ b/3rdparty/zlib/inflate.c
@@ -228,6 +228,7 @@ int stream_size;
state->strm = strm;
state->window = Z_NULL;
state->mode = HEAD; /* to pass state test in inflateReset2() */
+ state->check = 1L; /* 1L is the result of adler32() zero length data */
ret = inflateReset2(strm, windowBits);
if (ret != Z_OK) {
ZFREE(strm, state);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment