diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-02-12 17:01:25 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-02-12 17:01:25 +0000 |
commit | 35cedb0a58029bfbd9eeeeacb9a8473ff2876357 (patch) | |
tree | c57c88c77fbc80b596ee8b71adf1bdb8a6ea1616 | |
parent | dc18fc32e1d3b35b578f1691a6ff92e40c82564b (diff) | |
parent | 96bbe1be3610ee5a8599560e605ff5ed4f70a45c (diff) | |
download | zlib-android13-d4-s1-release.tar.gz |
Merge cherrypicks of ['googleplex-android-review.googlesource.com/20545900'] into tm-d4-release.android-13.0.0_r48android-13.0.0_r47android-13.0.0_r46android13-d4-s2-releaseandroid13-d4-s1-releaseandroid13-d4-release
Change-Id: I86cd7a7d5713fd18805fea95b5e7bee883f74d6e
-rw-r--r-- | contrib/optimizations/inflate.c | 5 | ||||
-rw-r--r-- | inflate.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/contrib/optimizations/inflate.c b/contrib/optimizations/inflate.c index 81d558b..93776ac 100644 --- a/contrib/optimizations/inflate.c +++ b/contrib/optimizations/inflate.c @@ -771,8 +771,9 @@ int flush; if (copy > have) copy = have; if (copy) { if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; + state->head->extra != Z_NULL && + (len = state->head->extra_len - state->length) < + state->head->extra_max) { zmemcpy(state->head->extra + len, next, len + copy > state->head->extra_max ? state->head->extra_max - len : copy); @@ -760,8 +760,9 @@ int flush; if (copy > have) copy = have; if (copy) { if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; + state->head->extra != Z_NULL && + (len = state->head->extra_len - state->length) < + state->head->extra_max) { zmemcpy(state->head->extra + len, next, len + copy > state->head->extra_max ? state->head->extra_max - len : copy); |