Skip to content

Commit

Permalink
deps: update zlib to 1.2.13.1-motley-3ca9f16
Browse files Browse the repository at this point in the history
PR-URL: #48413
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
  • Loading branch information
nodejs-github-bot authored and ruyadorno committed Sep 12, 2023
1 parent b2bc839 commit f0e2e3c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion deps/zlib/OWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
agl@chromium.org
cavalcantii@chromium.org
cblume@chromium.org
noel@chromium.org
scroggo@google.com
1 change: 0 additions & 1 deletion deps/zlib/contrib/bench/OWNERS
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
noel@chromium.org
1 change: 0 additions & 1 deletion deps/zlib/contrib/tests/fuzzers/OWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
cblume@chromium.org
hans@chromium.org
noel@chromium.org
6 changes: 6 additions & 0 deletions deps/zlib/contrib/tests/fuzzers/deflate_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
int ret =
deflateInit2(&stream, level, Z_DEFLATED, windowBits, memLevel, strategy);
ASSERT(ret == Z_OK);

size_t deflate_bound = deflateBound(&stream, src.size());

std::vector<uint8_t> compressed(src.size() * 2 + 1000);
stream.next_out = compressed.data();
stream.avail_out = compressed.size();
Expand All @@ -54,6 +57,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
compressed.resize(compressed.size() - stream.avail_out);
deflateEnd(&stream);

// Check that the bound was correct.
ASSERT(compressed.size() <= deflate_bound);

// Verify that the data decompresses correctly.
ret = inflateInit2(&stream, windowBits);
ASSERT(ret == Z_OK);
Expand Down
7 changes: 3 additions & 4 deletions deps/zlib/contrib/tests/infcover.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,7 @@ void cover_support(void)
mem_setup(&strm);
strm.avail_in = 0;
strm.next_in = Z_NULL;
char versioncpy[] = ZLIB_VERSION;
versioncpy[0] -= 1;
ret = inflateInit_(&strm, versioncpy, (int)sizeof(z_stream));
ret = inflateInit_(&strm, "!", (int)sizeof(z_stream));
assert(ret == Z_VERSION_ERROR);
mem_done(&strm, "wrong version");

Expand Down Expand Up @@ -486,7 +484,8 @@ local unsigned pull(void *desc, unsigned char **buf)

local int push(void *desc, unsigned char *buf, unsigned len)
{
buf += len;
(void)buf;
(void)len;
return desc != Z_NULL; /* force error if desc not null */
}

Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/zconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ typedef uLong FAR uLongf;
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
# if defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
Expand Down
2 changes: 1 addition & 1 deletion deps/zlib/zconf.h.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ typedef uLong FAR uLongf;
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
# if defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
Expand Down