summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorDan McDonald <danmcd@mnx.io>2022-08-19 18:20:38 -0400
committerDan McDonald <danmcd@mnx.io>2022-08-19 18:20:38 -0400
commite69277e9bf2d3f3b60b91f65e938043143cb46ee (patch)
tree1c3f5dec6f0c05089c189b593e4f927fd20bf833 /usr
parentabd110cdd84c8222873b05c48cafe2789600f977 (diff)
parent2e401babeb53295c8df347e32364beadc0ed1620 (diff)
downloadillumos-joyent-e69277e9bf2d3f3b60b91f65e938043143cb46ee.tar.gz
[illumos-gate merge]
commit 2e401babeb53295c8df347e32364beadc0ed1620 14917 zlib: Fix a bug when getting a gzip header extra field with inflate().
Diffstat (limited to 'usr')
-rw-r--r--usr/src/contrib/zlib/inflate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr/src/contrib/zlib/inflate.c b/usr/src/contrib/zlib/inflate.c
index baf5bb872e..9ad66f2287 100644
--- a/usr/src/contrib/zlib/inflate.c
+++ b/usr/src/contrib/zlib/inflate.c
@@ -744,8 +744,9 @@ int ZEXPORT inflate(z_streamp strm, 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);