Skip to content

Commit 5aff13b

Browse files
committed
zlib 1.3.1
1 parent 5372a0f commit 5aff13b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+4092
-433
lines changed

zlib/CMakeLists.txt

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
33

44
project(zlib C)
55

6-
set(VERSION "1.3")
6+
set(VERSION "1.3.1")
7+
8+
option(ZLIB_BUILD_EXAMPLES "Enable Zlib Examples" ON)
79

810
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
911
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
@@ -148,7 +150,9 @@ if(MINGW)
148150
endif(MINGW)
149151

150152
add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
153+
target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
151154
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
155+
target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
152156
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
153157
set_target_properties(zlib PROPERTIES SOVERSION 1)
154158

@@ -166,7 +170,7 @@ endif()
166170
if(UNIX)
167171
# On unix-like platforms the library is almost always called libz
168172
set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
169-
if(NOT APPLE)
173+
if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
170174
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
171175
endif()
172176
elseif(BUILD_SHARED_LIBS AND WIN32)
@@ -193,21 +197,22 @@ endif()
193197
#============================================================================
194198
# Example binaries
195199
#============================================================================
196-
197-
add_executable(example test/example.c)
198-
target_link_libraries(example zlib)
199-
add_test(example example)
200-
201-
add_executable(minigzip test/minigzip.c)
202-
target_link_libraries(minigzip zlib)
203-
204-
if(HAVE_OFF64_T)
205-
add_executable(example64 test/example.c)
206-
target_link_libraries(example64 zlib)
207-
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
208-
add_test(example64 example64)
209-
210-
add_executable(minigzip64 test/minigzip.c)
211-
target_link_libraries(minigzip64 zlib)
212-
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
200+
if(ZLIB_BUILD_EXAMPLES)
201+
add_executable(example test/example.c)
202+
target_link_libraries(example zlib)
203+
add_test(example example)
204+
205+
add_executable(minigzip test/minigzip.c)
206+
target_link_libraries(minigzip zlib)
207+
208+
if(HAVE_OFF64_T)
209+
add_executable(example64 test/example.c)
210+
target_link_libraries(example64 zlib)
211+
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
212+
add_test(example64 example64)
213+
214+
add_executable(minigzip64 test/minigzip.c)
215+
target_link_libraries(minigzip64 zlib)
216+
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
217+
endif()
213218
endif()

zlib/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.3.1 (22 Jan 2024)
5+
- Reject overflows of zip header fields in minizip
6+
- Fix bug in inflateSync() for data held in bit buffer
7+
- Add LIT_MEM define to use more memory for a small deflate speedup
8+
- Fix decision on the emission of Zip64 end records in minizip
9+
- Add bounds checking to ERR_MSG() macro, used by zError()
10+
- Neutralize zip file traversal attacks in miniunz
11+
- Fix a bug in ZLIB_DEBUG compiles in check_match()
12+
- Various portability and appearance improvements
13+
414
Changes in 1.3 (18 Aug 2023)
515
- Remove K&R function definitions and zlib2ansi
616
- Fix bug in deflateBound() for level 0 and memLevel 9

zlib/FAQ

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ The latest zlib FAQ is at http://zlib.net/zlib_faq.html
1414
2. Where can I get a Windows DLL version?
1515

1616
The zlib sources can be compiled without change to produce a DLL. See the
17-
file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the
18-
precompiled DLL are found in the zlib web site at http://zlib.net/ .
17+
file win32/DLL_FAQ.txt in the zlib distribution.
1918

2019
3. Where can I get a Visual Basic interface to zlib?
2120

zlib/Makefile.in

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Makefile for zlib
2-
# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
2+
# Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
33
# For conditions of distribution and use, see copyright notice in zlib.h
44

55
# To compile and test, type:
@@ -22,13 +22,13 @@ CFLAGS=-O
2222

2323
SFLAGS=-O
2424
LDFLAGS=
25-
TEST_LDFLAGS=$(LDFLAGS) -L. libz.a
25+
TEST_LIBS=-L. libz.a
2626
LDSHARED=$(CC)
2727
CPP=$(CC) -E
2828

2929
STATICLIB=libz.a
3030
SHAREDLIB=libz.so
31-
SHAREDLIBV=libz.so.1.3
31+
SHAREDLIBV=libz.so.1.3.1
3232
SHAREDLIBM=libz.so.1
3333
LIBS=$(STATICLIB) $(SHAREDLIBV)
3434

@@ -282,10 +282,10 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
282282
-@rmdir objs
283283

284284
example$(EXE): example.o $(STATICLIB)
285-
$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
285+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ example.o $(TEST_LIBS)
286286

287287
minigzip$(EXE): minigzip.o $(STATICLIB)
288-
$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
288+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip.o $(TEST_LIBS)
289289

290290
examplesh$(EXE): example.o $(SHAREDLIBV)
291291
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
@@ -294,10 +294,10 @@ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
294294
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
295295

296296
example64$(EXE): example64.o $(STATICLIB)
297-
$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
297+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ example64.o $(TEST_LIBS)
298298

299299
minigzip64$(EXE): minigzip64.o $(STATICLIB)
300-
$(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
300+
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip64.o $(TEST_LIBS)
301301

302302
install-libs: $(LIBS)
303303
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
@@ -360,7 +360,7 @@ zconf: $(SRCDIR)zconf.h.in
360360
cp -p $(SRCDIR)zconf.h.in zconf.h
361361

362362
minizip-test: static
363-
cd contrib/minizip && { CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
363+
cd contrib/minizip && { CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
364364

365365
minizip-clean:
366366
cd contrib/minizip && { $(MAKE) clean ; cd ../.. ; }

zlib/README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ZLIB DATA COMPRESSION LIBRARY
22

3-
zlib 1.3 is a general purpose data compression library. All the code is
3+
zlib 1.3.1 is a general purpose data compression library. All the code is
44
thread safe. The data format used by the zlib library is described by RFCs
55
(Request for Comments) 1950 to 1952 in the files
66
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -31,7 +31,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
3131
issue of Dr. Dobb's Journal; a copy of the article is available at
3232
https://marknelson.us/posts/1997/01/01/zlib-engine.html .
3333

34-
The changes made in version 1.3 are documented in the file ChangeLog.
34+
The changes made in version 1.3.1 are documented in the file ChangeLog.
3535

3636
Unsupported third party contributions are provided in directory contrib/ .
3737

@@ -83,7 +83,7 @@ Acknowledgments:
8383

8484
Copyright notice:
8585

86-
(C) 1995-2023 Jean-loup Gailly and Mark Adler
86+
(C) 1995-2024 Jean-loup Gailly and Mark Adler
8787

8888
This software is provided 'as-is', without any express or implied
8989
warranty. In no event will the authors be held liable for any damages

zlib/configure

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if test $SRCDIR = "."; then
2525
ZINCOUT="-I."
2626
SRCDIR=""
2727
else
28-
ZINC='-include zconf.h'
28+
ZINC='-I. -include zconf.h'
2929
ZINCOUT='-I. -I$(SRCDIR)'
3030
SRCDIR="$SRCDIR/"
3131
fi
@@ -44,7 +44,8 @@ STATICLIB=libz.a
4444

4545
# extract zlib version numbers from zlib.h
4646
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h`
47-
VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
47+
VER3=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\(\\.[0-9]\{1,\}\)\{1,2\}\).*/\1/p'`
48+
VER1=`echo ${VER}|sed -n -e 's/\([0-9]\{1,\}\)\\..*/\1/p'`
4849

4950
# establish commands for library building
5051
if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
@@ -263,7 +264,7 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
263264
SHAREDLIB=libz$shared_ext
264265
SHAREDLIBV=libz.$VER$shared_ext
265266
SHAREDLIBM=libz.$VER1$shared_ext
266-
LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"}
267+
LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
267268
if "${CROSS_PREFIX}libtool" -V 2>&1 | grep Apple > /dev/null; then
268269
AR="${CROSS_PREFIX}libtool"
269270
elif libtool -V 2>&1 | grep Apple > /dev/null; then
@@ -441,7 +442,7 @@ EOF
441442
if test $shared -eq 1; then
442443
echo Checking for shared library support... | tee -a configure.log
443444
# we must test in two steps (cc then ld), required at least on SunOS 4.x
444-
if try $CC -w -c $SFLAGS $test.c &&
445+
if try $CC -c $SFLAGS $test.c &&
445446
try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
446447
echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
447448
elif test -z "$old_cc" -a -z "$old_cflags"; then

zlib/contrib/delphi/ZLib.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
152152
const OutBuf: Pointer; BufSize: Integer);
153153

154154
const
155-
zlib_version = '1.3.0';
155+
zlib_version = '1.3.1';
156156

157157
type
158158
EZlibError = class(Exception);

zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public ChecksumGeneratorBase()
3434
}
3535

3636
/// <summary>
37-
/// Initializes a new instance of the checksum generator basewith a specified value
37+
/// Initializes a new instance of the checksum generator base with a specified value
3838
/// </summary>
3939
/// <param name="initialValue">The value to set the current checksum to</param>
4040
public ChecksumGeneratorBase(uint initialValue)

zlib/contrib/dotzlib/DotZLib/UnitTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public class InfoTests
156156
public void Info_Version()
157157
{
158158
Info info = new Info();
159-
Assert.AreEqual("1.3.0", Info.Version);
159+
Assert.AreEqual("1.3.1", Info.Version);
160160
Assert.AreEqual(32, info.SizeOfUInt);
161161
Assert.AreEqual(32, info.SizeOfULong);
162162
Assert.AreEqual(32, info.SizeOfPointer);

zlib/contrib/infback9/inftree9.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* inftree9.c -- generate Huffman trees for efficient decoding
2-
* Copyright (C) 1995-2023 Mark Adler
2+
* Copyright (C) 1995-2024 Mark Adler
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55

@@ -9,7 +9,7 @@
99
#define MAXBITS 15
1010

1111
const char inflate9_copyright[] =
12-
" inflate9 1.3 Copyright 1995-2023 Mark Adler ";
12+
" inflate9 1.3.1 Copyright 1995-2024 Mark Adler ";
1313
/*
1414
If you use the zlib library in a product, an acknowledgment is welcome
1515
in the documentation of your product. If for some reason you cannot
@@ -59,7 +59,7 @@ int inflate_table9(codetype type, unsigned short FAR *lens, unsigned codes,
5959
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
6060
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
6161
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
62-
133, 133, 133, 133, 144, 198, 203};
62+
133, 133, 133, 133, 144, 203, 77};
6363
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
6464
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
6565
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,

0 commit comments

Comments
 (0)