1cb93a386Sopenharmony_ciFrom 1a03e7aec95d89c659fd91f195b99893b6458cd7 Mon Sep 17 00:00:00 2001
2cb93a386Sopenharmony_ciFrom: Adenilson Cavalcanti <adenilson.cavalcanti@arm.com>
3cb93a386Sopenharmony_ciDate: Wed, 27 Sep 2017 13:59:04 -0700
4cb93a386Sopenharmony_ciSubject: [PATCH] Zlib patch: prevent uninitialized use of state->check
5cb93a386Sopenharmony_ci
6cb93a386Sopenharmony_ciNo need to call the Adler32 checksum function, just set
7cb93a386Sopenharmony_cithe struct field to the expected value.
8cb93a386Sopenharmony_ci
9cb93a386Sopenharmony_ciUpstream bug: madler/zlib#245
10cb93a386Sopenharmony_ci---
11cb93a386Sopenharmony_ci third_party/zlib/inflate.c                             |  2 +-
12cb93a386Sopenharmony_ci 1 files changed, 1 insertion(+), 1 deletions(-)
13cb93a386Sopenharmony_ci delete mode 100644 third_party/zlib/patches/0002-uninitializedcheck.patch
14cb93a386Sopenharmony_ci
15cb93a386Sopenharmony_cidiff --git a/third_party/zlib/inflate.c b/third_party/zlib/inflate.c
16cb93a386Sopenharmony_ciindex bec9497..5c40cf1 100644
17cb93a386Sopenharmony_ci--- a/third_party/zlib/inflate.c
18cb93a386Sopenharmony_ci+++ b/third_party/zlib/inflate.c
19cb93a386Sopenharmony_ci@@ -228,7 +228,7 @@ int stream_size;
20cb93a386Sopenharmony_ci     state->strm = strm;
21cb93a386Sopenharmony_ci     state->window = Z_NULL;
22cb93a386Sopenharmony_ci     state->mode = HEAD;     /* to pass state test in inflateReset2() */
23cb93a386Sopenharmony_ci-    state->check = adler32(0L, Z_NULL, 0);
24cb93a386Sopenharmony_ci+    state->check = 1L;      /* 1L is the result of adler32() zero length data */
25cb93a386Sopenharmony_ci     ret = inflateReset2(strm, windowBits);
26cb93a386Sopenharmony_ci     if (ret != Z_OK) {
27cb93a386Sopenharmony_ci         ZFREE(strm, state);
28