aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-09 00:25:42 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-09 00:25:42 +0000
commit14d15d12e3c04319bb5161de586c0cce9abe76ae (patch)
tree7523d321dd5364cebd7d55872a91646b333490be
parent814e03dabb67e1b5d41b2113d2d34b820d4df9f4 (diff)
parentb652cb7b666c224e5ffdac0ad373611654bc70fa (diff)
downloadangle-14d15d12e3c04319bb5161de586c0cce9abe76ae.tar.gz
Change-Id: Ica6330de4d64e213e535c220f0c4298a5351166e
-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);