summaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorAdenilson Cavalcanti <adenilson.cavalcanti@arm.com>2017-09-28 04:31:06 +0000
committerCommit Bot <commit-bot@chromium.org>2017-09-28 04:31:06 +0000
commit3086c3e2eb5f280f51240a0cdc962a34e26f0e2f (patch)
treed2114bc31571695e7fc13276a3f87524a7ceaac5 /inflate.c
parente7afdfe128e01ca480a28f757b571957befdd962 (diff)
downloadzlib-3086c3e2eb5f280f51240a0cdc962a34e26f0e2f.tar.gz
Zlib patch: prevent uninitialized use of state->check
No need to call the Adler32 checksum function, just set the struct field to the expected value. Plus some cleanup in the README file (the idea is that this file won't be touched for new patches). Upstream bug: madler/zlib#245 Bug: 697481 Change-Id: Ic495c92c9ca1b5ab8a4d23a8ae29141f4617c091 Reviewed-on: https://chromium-review.googlesource.com/688501 Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Chris Blume <cblume@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#504897} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: ee376c65abdd5afe787bfb63af9f2e82fdc35c2e
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/inflate.c b/inflate.c
index bec9497..5c40cf1 100644
--- a/inflate.c
+++ b/inflate.c
@@ -228,7 +228,7 @@ int stream_size;
state->strm = strm;
state->window = Z_NULL;
state->mode = HEAD; /* to pass state test in inflateReset2() */
- state->check = adler32(0L, Z_NULL, 0);
+ state->check = 1L; /* 1L is the result of adler32() zero length data */
ret = inflateReset2(strm, windowBits);
if (ret != Z_OK) {
ZFREE(strm, state);