summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-03-15 21:32:55 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-03-15 21:32:55 +0000
commitb8da133fe1e4a004dbb9e421ec1d1212ccd9f310 (patch)
tree2f77b88bc87d8d1a90db272bb2385689b0298541 /sys
parenta308ef324313d93020c56a2e6412f8dacd654cb0 (diff)
zlib: sync with src
Diffstat (limited to 'sys')
-rw-r--r--sys/lib/libz/deflate.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/lib/libz/deflate.c b/sys/lib/libz/deflate.c
index 598d5a2b2ad..e653d530c51 100644
--- a/sys/lib/libz/deflate.c
+++ b/sys/lib/libz/deflate.c
@@ -842,13 +842,13 @@ uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) {
storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) +
(sourceLen >> 11) + 7;
- /* if can't get parameters, return larger bound plus a zlib wrapper */
+ /* if can't get parameters, return larger bound plus a wrapper */
if (deflateStateCheck(strm))
- return (fixedlen > storelen ? fixedlen : storelen) + 6;
+ return (fixedlen > storelen ? fixedlen : storelen) + 18;
/* compute wrapper length */
s = strm->state;
- switch (s->wrap) {
+ switch (s->wrap < 0 ? -s->wrap : s->wrap) {
case 0: /* raw deflate */
wraplen = 0;
break;
@@ -878,7 +878,7 @@ uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) {
break;
#endif
default: /* for compiler happiness */
- wraplen = 6;
+ wraplen = 18;
}
/* if not default parameters, return one of the conservative bounds */