diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-19 17:01:28 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-19 17:01:28 +0000 |
commit | ef967505d84a6fdb395d58a698999632b55b86b3 (patch) | |
tree | 7efd1dcb6cb590f747048e71132b4f2277ad1560 | |
parent | 389ade8054b7438e9f4e205e8b88f6900d71d85e (diff) | |
parent | 036115db61e03e5b36443dfd8ca2a70c54b0d723 (diff) | |
download | zlib-android11-platform-release.tar.gz |
Merge cherrypicks of ['ag/20545896'] into rvc-platform-release.android-platform-11.0.0_r40android-platform-11.0.0_r39android-platform-11.0.0_r38android-platform-11.0.0_r37android-platform-11.0.0_r36android-platform-11.0.0_r35android-platform-11.0.0_r34android-platform-11.0.0_r33android-platform-11.0.0_r32android-platform-11.0.0_r31android-platform-11.0.0_r30android-platform-11.0.0_r29android-platform-11.0.0_r28android11-platform-release
Change-Id: I9bdfa11b62a7200d9a5b005da083cc9cda7dc682
-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); |