aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-01-14 22:09:15 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-01-14 22:09:15 +0000
commit5000ec2ee9e38ede3afc5cdf8781aa08fb12f636 (patch)
tree39b447b9a386f15fc981e24ad2df65f1d4828a23
parent32a66cde46ee178593bd58480697bfa38bd7d5c9 (diff)
parentb93a9f24aa3f24ff8924e73b9d2ec964906c08a7 (diff)
downloadangle-android13-d3-s1-release.tar.gz
Snap for 9491515 from b93a9f24aa3f24ff8924e73b9d2ec964906c08a7 to tm-d3-releaseandroid-13.0.0_r57android13-d3-s1-release
Change-Id: I6d042487e1ad45cb8a8219c10c48ac750da443db
-rw-r--r--third_party/zlib/contrib/optimizations/inflate.c5
-rw-r--r--third_party/zlib/inflate.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/third_party/zlib/contrib/optimizations/inflate.c b/third_party/zlib/contrib/optimizations/inflate.c
index 4841cd964c..bb223af9c5 100644
--- a/third_party/zlib/contrib/optimizations/inflate.c
+++ b/third_party/zlib/contrib/optimizations/inflate.c
@@ -772,8 +772,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);
diff --git a/third_party/zlib/inflate.c b/third_party/zlib/inflate.c
index 7543c33def..a9e2dddba4 100644
--- a/third_party/zlib/inflate.c
+++ b/third_party/zlib/inflate.c
@@ -761,8 +761,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);