This adds a new public API, deflateUsed(), so is technically a minor bump.
Nothing will be using this anytime soon, so no shared library bump.
discussed with deraadt during c2k24
Since we already pulled in all fixes, this only bumps version/magic numbers
and copyright years. The fixes relevant to OpenBSD are:
- Fix bug in inflateSync() for data held in bit buffer
- Add LIT_MEM define to use more memory for a small deflate speedup
- Add bounds checking to ERR_MSG() macro, used by zError()
- Various portability and appearance improvements
Apart from cosmetics, this includes the following commits:
Add LIT_MEM define to use more memory for a small deflate speedup.
A bug fix in zlib 1.2.12 resulted in a slight slowdown (1-2%) of
deflate. This commit provides the option to #define LIT_MEM, which
uses more memory to reverse most of that slowdown. The memory for
the pending buffer and symbol buffers is increased by 25%, which
increases the total memory usage with the default parameters by
about 6%.
ac8f12c97d
Fix bug in inflateSync() for data held in bit buffer.
5af7cef45e
This mostly moves from K&R prototypes to ANSI prototypes and includes a
handful of bug fixes that are nice to have. The corresponding sys commit
will allow us to undo some hacks that jca applied to make the kernel build
with clang 15.
discussed with deraadt
We're not maintaining a this as a fork, it's upstream source with a handful
of patches. Thus, the RCS ids aren't particularly useful or important. They
are a bit of a maintenance burden and generate noise in diffs.
ok kn, no objection millert, "kill" guess who
This update contains a few bugfixes (some of which we have already
backported to 1.2.12) and a ton of cosmetic changes. The relevant
bits of the ChangeLog are:
- Repair prototypes and exporting of new CRC functions
- Have infback() deliver all of the available output up to any error
- Fix a bug when getting a gzip header extra field with inflate()
- Fix bug in block type selection when Z_FIXED used
- Tighten deflateBound bounds
- Remove deleted assembler code references
- Various portability and appearance improvements
Tested on amd64 and arm64 by me and on sparc64 by kn.
Build tests by myself for amd64 and arm64, sthen and inoguchi for i386
and gkoehler for macppc and powerpc64, thanks!
Detailed changelog is part of the committed diff.
zlib has a crashing bug. The bug fix has been sitting in the
unreleased develop branch for nearly four years. Pull in this fix.
ok mbuhl millert
Reported by Tavis Ormandy on oss-security:
https://marc.info/?l=oss-security&m=164809382107156&w=2
commit 5c44459c3b28a9bd3283aaceab7c615f8020c531
Author: Mark Adler <madler@alumni.caltech.edu>
Date: Tue Apr 17 22:09:22 2018 -0700
Fix a bug that can crash deflate on some input when using Z_FIXED.
This bug was reported by Danilo Ramos of Eideticom, Inc. It has
lain in wait 13 years before being found! The bug was introduced
in zlib 1.2.2.2, with the addition of the Z_FIXED option. That
option forces the use of fixed Huffman codes. For rare inputs with
a large number of distant matches, the pending buffer into which
the compressed data is written can overwrite the distance symbol
table which it overlays. That results in corrupted output due to
invalid distances, and can result in out-of-bound accesses,
crashing the application.
The fix here combines the distance buffer and literal/length
buffers into a single symbol buffer. Now three bytes of pending
buffer space are opened up for each literal or length/distance
pair consumed, instead of the previous two bytes. This assures
that the pending buffer cannot overwrite the symbol table, since
the maximum fixed code compressed length/distance is 31 bits, and
since there are four bytes of pending space for every three bytes
of symbol space.
5c44459c3b