32 Commits

Author SHA1 Message Date
Mark Adler 09a1572aa6 Fix inflateBack() bug that would fail to detect a too far back.
The bug would pass off an invalid deflate stream as good, and copy
uninitialized memory contents to the output.
2026-02-21 23:07:18 -08:00
Mark Adler 9e35567064 Version 1.3.2 2026-02-17 04:47:06 -08:00
Mark Adler fb8dd62f77 Clean up the use of switch cases. 2026-02-10 22:37:25 -08:00
Mark Adler c267ef7306 Use atomics to build inflate fixed tables once.
This moves the once code from crc32.c to zutil.c, and uses it also
for building the inflate fixed tables when BUILDFIXED is defined.
The fixed tables are now housed in inftrees.c, shared by inflate.c
and infback.c. The once() function is now external, and so is
renamed to z_once() to avoid name collisions.

If either BUILDFIXED or DYNAMIC_CRC_TABLE is defined, and atomics
are not available, then a warning is issued noting that zlib is not
thread-safe.
2026-01-05 15:03:04 -06:00
Mark Adler 570720b0c2 zlib 1.3.1.2
Interim version for an audit.
2025-12-08 05:30:18 -08:00
Mark Adler 68320827df Constrain line lengths in inflate code. 2025-05-13 18:00:03 -07:00
Mark Adler 71045aef60 Fix indent in infback.c. 2024-12-30 18:52:33 -08:00
Lwisce Zeng 2ba25b2dda Use z_const for setting msg to literal strings. 2024-04-01 11:49:05 -07:00
Mark Adler e9d5486e66 Remove K&R function definitions from zlib.
C2X has removed K&R definitions from the C function syntax.
Though the standard has not yet been approved, some high-profile
compilers are now issuing warnings when such definitions are
encountered.
2023-04-15 21:17:31 -07:00
Mark Adler b8bd09801f Have infback() deliver all of the available output up to any error. 2022-07-24 11:41:07 -07:00
Mark Adler 2333419cd7 Fix inflateBack to detect invalid input with distances too far. 2022-06-27 12:20:04 -07:00
Mark Adler 21767c654d zlib 1.2.12 2022-03-27 16:05:02 -07:00
Mark Adler 76f70abbc7 Add fallthrough comments for gcc.
Note intentional switch case fall throughs to avoid gcc warnings.
2022-03-27 01:54:10 -07:00
Mark Adler 2fa463bacf zlib 1.2.9 2016-12-31 23:37:10 -08:00
Mark Adler 7096424f23 Clean up type conversions. 2016-10-11 22:15:50 -07:00
Mark Adler 62d6112a79 Clean up the usage of z_const and respect const usage within zlib.
This patch allows zlib to compile cleanly with the -Wcast-qual gcc
warning enabled, but only if ZLIB_CONST is defined, which adds
const to next_in and msg in z_stream and in the in_func prototype.
A --const option is added to ./configure which adds -DZLIB_CONST
to the compile flags, and adds -Wcast-qual to the compile flags
when ZLIBGCCWARN is set in the environment.
2012-08-13 00:02:40 -07:00
Mark Adler fe61dfb8a2 zlib 1.2.5.2 2011-12-18 10:39:45 -08:00
Mark Adler de32a2d749 Remove code from inflate.c and infback.c that is impossible to execute.
During coverage testing it was discovered that these two lines could
never pull more bits, since the immediately preceding for loop assures
that all of the code's bits are already pulled.
2011-11-27 14:15:40 -08:00
Mark Adler f442c1e89e Add a ./config --solo option to make zlib subset with no libary use
A common request has been the ability to compile zlib to require no
other libraries.  This --solo option provides that ability.  The price
is that the gz*, compress*, and uncompress functions are eliminated,
and that the user must provide memory allocation and free routines to
deflate and inflate when initializing.
2011-10-07 02:11:56 -07:00
Mark Adler d004b04783 zlib 1.2.3.5 2011-09-09 23:26:49 -07:00
Mark Adler f6194ef39a zlib 1.2.3.4 2011-09-09 23:26:40 -07:00
Mark Adler 639be99788 zlib 1.2.3.3 2011-09-09 23:26:29 -07:00
Mark Adler 9c3a583021 zlib 1.2.2.4 2011-09-09 23:24:52 -07:00
Mark Adler 0484693e17 zlib 1.2.2.2 2011-09-09 23:24:33 -07:00
Mark Adler 9811b53dd9 zlib 1.2.2.1 2011-09-09 23:24:24 -07:00
Mark Adler 79fbcdc939 zlib 1.2.2 2011-09-09 23:24:02 -07:00
Mark Adler 7a6955760b zlib 1.2.1.2 2011-09-09 23:23:45 -07:00
Mark Adler 4b5a43a219 zlib 1.2.0.5 2011-09-09 23:22:37 -07:00
Mark Adler 086e982175 zlib 1.2.0.4 2011-09-09 23:22:30 -07:00
Mark Adler 8e34b3a802 zlib 1.2.0.2 2011-09-09 23:22:10 -07:00
Mark Adler 13a294f044 zlib 1.2.0.1 2011-09-09 23:21:57 -07:00
Mark Adler 7c2a874e50 zlib 1.2.0 2011-09-09 23:21:47 -07:00