forked from opencv/opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3rdparty(zlib): prevent uninitialized use of state->check
ozz-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13317 PR: opencv#14193 zlib upstream bug: madler/zlib#245 Ported fix: https://chromium.googlesource.com/chromium/src/+/ee376c65abdd5afe787bfb63af9f2e82fdc35c2e
- Loading branch information
Showing
2 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
3rdparty/zlib/patches/20190330-ununitialized-use-state-check.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |