mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
3rdparty(zlib): prevent uninitialized use of state->check
backporting of commit: 8afb2f0cb7
This commit is contained in:
parent
7d3d6bc4e2
commit
10ce935823
1
3rdparty/zlib/inflate.c
vendored
1
3rdparty/zlib/inflate.c
vendored
@ -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);
|
||||
|
12
3rdparty/zlib/patches/20190330-ununitialized-use-state-check.diff
vendored
Normal file
12
3rdparty/zlib/patches/20190330-ununitialized-use-state-check.diff
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
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);
|
Loading…
Reference in New Issue
Block a user