aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-14 18:20:56 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-14 18:20:56 +0000
commit8a02186d3e8f31f6335fd7b4c2586d839dfec3f9 (patch)
tree39b447b9a386f15fc981e24ad2df65f1d4828a23
parentb4697d7c49c2bc27cf7e566bc3b3f8378f98bc01 (diff)
parent6a020bf505f4eb6d860eccf72ae6d6b4c4b720e9 (diff)
downloadangle-android13-qpr2-s10-release.tar.gz
Change-Id: I6cb4dc876052b5e09a43861737bd9200bd3548d1
-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);