Skip to content

Commit 6078774

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update zlib to 1.3.2.1-motley-3246f1b
PR-URL: #63773 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent bd67c9d commit 6078774

77 files changed

Lines changed: 5514 additions & 2309 deletions

Some content is hidden

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

deps/zlib/CMakeLists.txt

Lines changed: 253 additions & 141 deletions
Large diffs are not rendered by default.

deps/zlib/LICENSE

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
version 1.2.12, March 27th, 2022
1+
Copyright notice:
22

3-
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
3+
(C) 1995-2026 Jean-loup Gailly and Mark Adler
44

5-
This software is provided 'as-is', without any express or implied
6-
warranty. In no event will the authors be held liable for any damages
7-
arising from the use of this software.
5+
This software is provided 'as-is', without any express or implied
6+
warranty. In no event will the authors be held liable for any damages
7+
arising from the use of this software.
88

9-
Permission is granted to anyone to use this software for any purpose,
10-
including commercial applications, and to alter it and redistribute it
11-
freely, subject to the following restrictions:
9+
Permission is granted to anyone to use this software for any purpose,
10+
including commercial applications, and to alter it and redistribute it
11+
freely, subject to the following restrictions:
1212

13-
1. The origin of this software must not be misrepresented; you must not
14-
claim that you wrote the original software. If you use this software
15-
in a product, an acknowledgment in the product documentation would be
16-
appreciated but is not required.
17-
2. Altered source versions must be plainly marked as such, and must not be
18-
misrepresented as being the original software.
19-
3. This notice may not be removed or altered from any source distribution.
13+
1. The origin of this software must not be misrepresented; you must not
14+
claim that you wrote the original software. If you use this software
15+
in a product, an acknowledgment in the product documentation would be
16+
appreciated but is not required.
17+
2. Altered source versions must be plainly marked as such, and must not be
18+
misrepresented as being the original software.
19+
3. This notice may not be removed or altered from any source distribution.
20+
21+
Jean-loup Gailly Mark Adler
22+
jloup@gzip.org madler@alumni.caltech.edu

deps/zlib/README

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
ZLIB DATA COMPRESSION LIBRARY
2+
3+
zlib 1.3.2.1 is a general purpose data compression library. All the code is
4+
thread safe (though see the FAQ for caveats). The data format used by the zlib
5+
library is described by RFCs (Request for Comments) 1950 to 1952 at
6+
https://datatracker.ietf.org/doc/html/rfc1950 (zlib format), rfc1951 (deflate
7+
format) and rfc1952 (gzip format).
8+
9+
All functions of the compression library are documented in the file zlib.h
10+
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
11+
of the library is given in the file test/example.c which also tests that
12+
the library is working correctly. Another example is given in the file
13+
test/minigzip.c. The compression library itself is composed of all source
14+
files in the root directory.
15+
16+
To compile all files and run the test program, follow the instructions given at
17+
the top of Makefile.in. In short "./configure; make test", and if that goes
18+
well, "make install" should work for most flavors of Unix. For Windows, use
19+
one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
20+
make_vms.com.
21+
22+
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
23+
<info@winimage.com> for the Windows DLL version. The zlib home page is
24+
https://zlib.net/ . Before reporting a problem, please check this site to
25+
verify that you have the latest version of zlib; otherwise get the latest
26+
version and check whether the problem still exists or not.
27+
28+
PLEASE read the zlib FAQ https://zlib.net/zlib_faq.html before asking for help.
29+
30+
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
31+
issue of Dr. Dobb's Journal; a copy of the article is available at
32+
https://zlib.net/nelson/ .
33+
34+
The changes made in version 1.3.2.1 are documented in the file ChangeLog.
35+
36+
Unsupported third party contributions are provided in directory contrib/ .
37+
38+
zlib is available in Java using the java.util.zip package. Follow the API
39+
Documentation link at: https://docs.oracle.com/search/?q=java.util.zip .
40+
41+
A Perl interface to zlib and bzip2 written by Paul Marquess <pmqs@cpan.org>
42+
can be found at https://github.com/pmqs/IO-Compress .
43+
44+
A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
45+
available in Python 1.5 and later versions, see
46+
https://docs.python.org/3/library/zlib.html .
47+
48+
zlib is built into tcl: https://wiki.tcl-lang.org/page/zlib .
49+
50+
An experimental package to read and write files in .zip format, written on top
51+
of zlib by Gilles Vollant <info@winimage.com>, is available in the
52+
contrib/minizip directory of zlib.
53+
54+
55+
Notes for some targets:
56+
57+
- For Windows DLL versions, please see win32/DLL_FAQ.txt
58+
59+
- For 64-bit Irix, deflate.c must be compiled without any optimization. With
60+
-O, one libpng test fails. The test works in 32 bit mode (with the -n32
61+
compiler flag). The compiler bug has been reported to SGI.
62+
63+
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
64+
when compiled with cc.
65+
66+
- On Digital Unix 4.0D (formerly OSF/1) on AlphaServer, the cc option -std1 is
67+
necessary to get gzprintf working correctly. This is done by configure.
68+
69+
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
70+
other compilers. Use "make test" to check your compiler.
71+
72+
- For PalmOs, see https://palmzlib.sourceforge.net/
73+
74+
75+
Acknowledgments:
76+
77+
The deflate format used by zlib was defined by Phil Katz. The deflate and
78+
zlib specifications were written by L. Peter Deutsch. Thanks to all the
79+
people who reported problems and suggested various improvements in zlib; they
80+
are too numerous to cite here.
81+
82+
Copyright notice:
83+
84+
(C) 1995-2026 Jean-loup Gailly and Mark Adler
85+
86+
This software is provided 'as-is', without any express or implied
87+
warranty. In no event will the authors be held liable for any damages
88+
arising from the use of this software.
89+
90+
Permission is granted to anyone to use this software for any purpose,
91+
including commercial applications, and to alter it and redistribute it
92+
freely, subject to the following restrictions:
93+
94+
1. The origin of this software must not be misrepresented; you must not
95+
claim that you wrote the original software. If you use this software
96+
in a product, an acknowledgment in the product documentation would be
97+
appreciated but is not required.
98+
2. Altered source versions must be plainly marked as such, and must not be
99+
misrepresented as being the original software.
100+
3. This notice may not be removed or altered from any source distribution.
101+
102+
Jean-loup Gailly Mark Adler
103+
jloup@gzip.org madler@alumni.caltech.edu
104+
105+
If you use the zlib library in a product, we would appreciate *not* receiving
106+
lengthy legal documents to sign. The sources are provided for free but without
107+
warranty of any kind. The library has been entirely written by Jean-loup
108+
Gailly and Mark Adler; it does not include third-party code. We make all
109+
contributions to and distributions of this project solely in our personal
110+
capacity, and are not conveying any rights to any intellectual property of
111+
any third parties.
112+
113+
If you redistribute modified sources, we would appreciate that you include in
114+
the file ChangeLog history information documenting your changes. Please read
115+
the FAQ for more information on the distribution of modified source versions.

deps/zlib/README.chromium

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Name: zlib
22
Short Name: zlib
33
URL: https://github.com/madler/zlib
4-
Version: 1.3.1
5-
Revision: 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf
4+
Version: 1.3.2
5+
Revision: 09a1572aa624e5ddb6c075dc013880de70b1b9b9
66
Update Mechanism: Manual (https://crbug.com/422348588)
7-
CPEPrefix: cpe:/a:zlib:zlib:1.3.1
7+
CPEPrefix: cpe:/a:zlib:zlib:1.3.2
88
Security Critical: yes
99
Shipped: yes
1010
License: Zlib
@@ -33,6 +33,6 @@ Local Modifications:
3333
- Plus the changes in 'patches' folder.
3434
- Code in contrib/ other than contrib/minizip was added to match zlib's
3535
contributor layout.
36-
- In sync with 1.3.1 official release
36+
- In sync with 1.3.2 official release
3737
- ZIP reader modified to allow for progress callbacks during extraction.
3838
- ZIP reader modified to add detection of AES encrypted content.

deps/zlib/chromeconf.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,20 @@
4545
#define adler32_z Cr_z_adler32_z
4646
#define compress Cr_z_compress
4747
#define compress2 Cr_z_compress2
48+
#define compress_z Cr_z_compress_z
49+
#define compress2_z Cr_z_compress2_z
4850
#define compressBound Cr_z_compressBound
51+
#define compressBound_z Cr_z_compressBound_z
4952
#define crc32 Cr_z_crc32
5053
#define crc32_combine Cr_z_crc32_combine
5154
#define crc32_combine64 Cr_z_crc32_combine64
52-
#define crc32_combine_gen64 Cr_z_crc32_combine_gen64
5355
#define crc32_combine_gen Cr_z_crc32_combine_gen
56+
#define crc32_combine_gen64 Cr_z_crc32_combine_gen64
5457
#define crc32_combine_op Cr_z_crc32_combine_op
5558
#define crc32_z Cr_z_crc32_z
5659
#define deflate Cr_z_deflate
5760
#define deflateBound Cr_z_deflateBound
61+
#define deflateBound_z Cr_z_deflateBound_z
5862
#define deflateCopy Cr_z_deflateCopy
5963
#define deflateEnd Cr_z_deflateEnd
6064
#define deflateGetDictionary Cr_z_deflateGetDictionary
@@ -70,6 +74,7 @@
7074
#define deflateSetDictionary Cr_z_deflateSetDictionary
7175
#define deflateSetHeader Cr_z_deflateSetHeader
7276
#define deflateTune Cr_z_deflateTune
77+
#define deflateUsed Cr_z_deflateUsed
7378
#define deflate_copyright Cr_z_deflate_copyright
7479
#define get_crc_table Cr_z_get_crc_table
7580
#define gz_error Cr_z_gz_error
@@ -135,8 +140,11 @@
135140
#define inflate_copyright Cr_z_inflate_copyright
136141
#define inflate_fast Cr_z_inflate_fast
137142
#define inflate_table Cr_z_inflate_table
143+
#define inflate_fixed Cr_z_inflate_fixed
138144
#define uncompress Cr_z_uncompress
139145
#define uncompress2 Cr_z_uncompress2
146+
#define uncompress_z Cr_z_uncompress_z
147+
#define uncompress2_z Cr_z_uncompress2_z
140148
#define zError Cr_z_zError
141149
#define zcalloc Cr_z_zcalloc
142150
#define zcfree Cr_z_zcfree

deps/zlib/compress.c

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* compress.c -- compress a memory buffer
2-
* Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler
2+
* Copyright (C) 1995-2026 Jean-loup Gailly, Mark Adler
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55

@@ -18,13 +18,19 @@
1818
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
1919
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
2020
Z_STREAM_ERROR if the level parameter is invalid.
21+
22+
The _z versions of the functions take size_t length arguments.
2123
*/
22-
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
23-
uLong sourceLen, int level) {
24+
int ZEXPORT compress2_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
25+
z_size_t sourceLen, int level) {
2426
z_stream stream;
2527
int err;
2628
const uInt max = (uInt)-1;
27-
uLong left;
29+
z_size_t left;
30+
31+
if ((sourceLen > 0 && source == NULL) ||
32+
destLen == NULL || (*destLen > 0 && dest == NULL))
33+
return Z_STREAM_ERROR;
2834

2935
left = *destLen;
3036
*destLen = 0;
@@ -43,23 +49,36 @@ int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
4349

4450
do {
4551
if (stream.avail_out == 0) {
46-
stream.avail_out = left > (uLong)max ? max : (uInt)left;
52+
stream.avail_out = left > (z_size_t)max ? max : (uInt)left;
4753
left -= stream.avail_out;
4854
}
4955
if (stream.avail_in == 0) {
50-
stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
56+
stream.avail_in = sourceLen > (z_size_t)max ? max :
57+
(uInt)sourceLen;
5158
sourceLen -= stream.avail_in;
5259
}
5360
err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
5461
} while (err == Z_OK);
5562

56-
*destLen = stream.total_out;
63+
*destLen = (z_size_t)(stream.next_out - dest);
5764
deflateEnd(&stream);
5865
return err == Z_STREAM_END ? Z_OK : err;
5966
}
60-
67+
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
68+
uLong sourceLen, int level) {
69+
int ret;
70+
z_size_t got = *destLen;
71+
ret = compress2_z(dest, &got, source, sourceLen, level);
72+
*destLen = (uLong)got;
73+
return ret;
74+
}
6175
/* ===========================================================================
6276
*/
77+
int ZEXPORT compress_z(Bytef *dest, z_size_t *destLen, const Bytef *source,
78+
z_size_t sourceLen) {
79+
return compress2_z(dest, destLen, source, sourceLen,
80+
Z_DEFAULT_COMPRESSION);
81+
}
6382
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
6483
uLong sourceLen) {
6584
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
@@ -69,9 +88,10 @@ int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
6988
If the default memLevel or windowBits for deflateInit() is changed, then
7089
this function needs to be updated.
7190
*/
72-
uLong ZEXPORT compressBound(uLong sourceLen) {
73-
sourceLen = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
74-
(sourceLen >> 25) + 13;
91+
z_size_t ZEXPORT compressBound_z(z_size_t sourceLen) {
92+
z_size_t bound = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
93+
(sourceLen >> 25) + 13;
94+
7595
/* FIXME(cavalcantii): usage of CRC32 Castagnoli as a hash function
7696
* for the hash table of symbols used for compression has a side effect
7797
* where for compression level [4, 5] it will increase the output buffer size
@@ -80,6 +100,11 @@ uLong ZEXPORT compressBound(uLong sourceLen) {
80100
* the expected output size by 0.8% (i.e. 8x more than the worst scenario).
81101
* See: http://crbug.com/990489
82102
*/
83-
sourceLen += sourceLen >> 7; // Equivalent to 1.0078125
84-
return sourceLen;
103+
bound += bound >> 7; // Equivalent to 1.0078125
104+
105+
return bound < sourceLen ? (z_size_t)-1 : bound;
106+
}
107+
uLong ZEXPORT compressBound(uLong sourceLen) {
108+
z_size_t bound = compressBound_z(sourceLen);
109+
return (uLong)bound != bound ? (uLong)-1 : (uLong)bound;
85110
}

deps/zlib/contrib/minizip/Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
CC?=cc
2-
CFLAGS := -O $(CFLAGS) -I../..
1+
CPPFLAGS = -I../..
32

43
UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
54
ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
65

7-
.c.o:
8-
$(CC) -c $(CFLAGS) $*.c
9-
106
all: miniunz minizip
117

128
miniunz.o: miniunz.c unzip.h iowin32.h
@@ -18,10 +14,10 @@ iowin32.o: iowin32.c iowin32.h ioapi.h
1814
mztools.o: mztools.c unzip.h
1915

2016
miniunz: $(UNZ_OBJS)
21-
$(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
17+
${CC} ${LDFLAGS} -o $@ $(UNZ_OBJS)
2218

2319
minizip: $(ZIP_OBJS)
24-
$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
20+
${CC} ${LDFLAGS} -o $@ $(ZIP_OBJS)
2521

2622
test: miniunz minizip
2723
@rm -f test.*

deps/zlib/contrib/minizip/README.chromium

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Name: ZIP file API for reading file entries in a ZIP archive
22
Short Name: minizip
33
URL: https://github.com/madler/zlib/tree/master/contrib/minizip
4-
Version: 1.3.1.1
5-
Revision: ef24c4c7502169f016dcd2a26923dbaf3216748c
4+
Version: 1.3.2
5+
Revision: 09a1572aa624e5ddb6c075dc013880de70b1b9b9
66
Update Mechanism: Manual
77
License: Zlib
88
License File: //third_party/zlib/LICENSE
@@ -40,3 +40,6 @@ Local Modifications:
4040
large CRX files).
4141
0018-support-prefixed-zip64.patch
4242

43+
- Added stricter parsing for zip64 candidates to avoid an issue where a zip64
44+
could be embedded in a non-zip64 zip.
45+
0019-fix-zip64-in-zip.patch

deps/zlib/contrib/minizip/crypt.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/* crypt.h -- base code for crypt/uncrypt ZIPfile
22
3-
4-
Version 1.01e, February 12th, 2005
5-
6-
Copyright (C) 1998-2005 Gilles Vollant
3+
Copyright (C) 1998-2026 Gilles Vollant
74
85
This code is a modified version of crypting code in Infozip distribution
96
@@ -23,7 +20,7 @@
2320
This code support the "Traditional PKWARE Encryption".
2421
2522
The new AES encryption added on Zip format by Winzip (see the page
26-
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
23+
https://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
2724
Encryption is not supported.
2825
*/
2926

@@ -50,7 +47,7 @@ static int update_keys(unsigned long* pkeys, const z_crc_t* pcrc_32_tab, int c)
5047
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
5148
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
5249
{
53-
register int keyshift = (int)((*(pkeys+1)) >> 24);
50+
int keyshift = (int)((*(pkeys+1)) >> 24);
5451
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
5552
}
5653
return c;
@@ -106,7 +103,7 @@ static unsigned crypthead(const char* passwd, /* password string */
106103
*/
107104
if (++calls == 1)
108105
{
109-
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
106+
srand((unsigned)time(NULL) ^ ZCR_SEED2);
110107
}
111108
init_keys(passwd, pkeys, pcrc_32_tab);
112109
for (n = 0; n < RAND_HEAD_LEN-2; n++)

0 commit comments

Comments
 (0)