Skip to content

Commit

Permalink
Merge pull request #14193 from alalek:fix_ossfuzz_13317
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Mar 30, 2019
2 parents 7442100 + 8afb2f0 commit 360758e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions 3rdparty/zlib/inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 12 additions & 0 deletions 3rdparty/zlib/patches/20190330-ununitialized-use-state-check.diff
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);

0 comments on commit 360758e

Please sign in to comment.