diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-10-18 20:24:43 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-10-18 20:24:43 (GMT) |
commit | 6a9dc785dc6069702330f2a6ec66b1717afbfbd7 (patch) | |
tree | 226868b4f0c2ccc905b6db60338e82195cf6be44 /compat/zlib/inflate.c | |
parent | c271044702cbeb60132593ac125711cfc557f67d (diff) | |
download | tcl-6a9dc785dc6069702330f2a6ec66b1717afbfbd7.zip tcl-6a9dc785dc6069702330f2a6ec66b1717afbfbd7.tar.gz tcl-6a9dc785dc6069702330f2a6ec66b1717afbfbd7.tar.bz2 |
Update to zlib-1.2.13
Diffstat (limited to 'compat/zlib/inflate.c')
-rw-r--r-- | compat/zlib/inflate.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compat/zlib/inflate.c b/compat/zlib/inflate.c index 7be8c63..8acbef4 100644 --- a/compat/zlib/inflate.c +++ b/compat/zlib/inflate.c @@ -168,6 +168,8 @@ int windowBits; /* extract wrap request from windowBits parameter */ if (windowBits < 0) { + if (windowBits < -15) + return Z_STREAM_ERROR; wrap = 0; windowBits = -windowBits; } @@ -764,8 +766,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); |