0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 03:07:54 +01:00

deps: update zlib to 1.3.0.1-motley-7e2e4d7

PR-URL: https://github.com/nodejs/node/pull/54432
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
Node.js GitHub Bot 2024-08-18 00:29:34 +00:00 committed by James M Snell
parent 6190bbc12c
commit 3889b449c4
5 changed files with 29 additions and 27 deletions

View File

@ -2,6 +2,7 @@ Name: zlib
Short Name: zlib
URL: http://zlib.net/
Version: 1.3.0.1
Revision: ac8f12c97d1afd9bafa9c710f827d40a407d3266
CPEPrefix: cpe:/a:zlib:zlib:1.3.0.1
Security Critical: yes
Shipped: yes

View File

@ -165,8 +165,7 @@ struct ZipBuffer {
// writing compressed data and it returns NULL for this case.)
void* OpenZipBuffer(void* opaque, const void* /*filename*/, int mode) {
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) != ZLIB_FILEFUNC_MODE_READ) {
NOTREACHED_IN_MIGRATION();
return NULL;
NOTREACHED();
}
ZipBuffer* buffer = static_cast<ZipBuffer*>(opaque);
if (!buffer || !buffer->data || !buffer->length)
@ -196,8 +195,7 @@ uLong WriteZipBuffer(void* /*opaque*/,
void* /*stream*/,
const void* /*buf*/,
uLong /*size*/) {
NOTREACHED_IN_MIGRATION();
return 0;
NOTREACHED();
}
// Returns the offset from the beginning of the data.
@ -228,8 +226,7 @@ long SeekZipBuffer(void* opaque,
buffer->offset = std::min(buffer->length, offset);
return 0;
}
NOTREACHED_IN_MIGRATION();
return -1;
NOTREACHED();
}
// Closes the input offset and deletes all resources used for compressing or

View File

@ -9,6 +9,7 @@
#include <string.h>
#include <iterator>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
@ -555,10 +556,10 @@ TEST_F(ZipReaderTest, ExtractToFileAsync_RegularFile) {
const std::string md5 = base::MD5String(output);
EXPECT_EQ(kQuuxExpectedMD5, md5);
int64_t file_size = 0;
ASSERT_TRUE(base::GetFileSize(target_file, &file_size));
std::optional<int64_t> file_size = base::GetFileSize(target_file);
ASSERT_TRUE(file_size.has_value());
EXPECT_EQ(file_size, listener.current_progress());
EXPECT_EQ(file_size.value(), listener.current_progress());
}
TEST_F(ZipReaderTest, ExtractToFileAsync_Encrypted_NoPassword) {

View File

@ -63,8 +63,9 @@ bool CreateFile(const std::string& content,
if (!base::CreateTemporaryFile(file_path))
return false;
if (base::WriteFile(*file_path, content.data(), content.size()) == -1)
if (!base::WriteFile(*file_path, content)) {
return false;
}
*file = base::File(
*file_path, base::File::Flags::FLAG_OPEN | base::File::Flags::FLAG_READ);
@ -350,7 +351,7 @@ class ZipTest : public PlatformTest {
base::Time now_time;
EXPECT_TRUE(base::Time::FromUTCExploded(now_parts, &now_time));
EXPECT_EQ(1, base::WriteFile(src_file, "1", 1));
EXPECT_TRUE(base::WriteFile(src_file, "1"));
EXPECT_TRUE(base::TouchFile(src_file, base::Time::Now(), test_mtime));
EXPECT_TRUE(zip::Zip(src_dir, zip_file, true));
@ -748,6 +749,8 @@ TEST_F(ZipTest, UnzipMixedPaths) {
"Space→", //
#else
" ", //
"...", // Disappears on Windows
"....", // Disappears on Windows
"AUX", // Disappears on Windows
"COM1", // Disappears on Windows
"COM2", // Disappears on Windows
@ -1113,9 +1116,9 @@ TEST_F(ZipTest, UnzipFilesWithIncorrectSize) {
SCOPED_TRACE(base::StringPrintf("Processing %d.txt", i));
base::FilePath file_path =
temp_dir.AppendASCII(base::StringPrintf("%d.txt", i));
int64_t file_size = -1;
EXPECT_TRUE(base::GetFileSize(file_path, &file_size));
EXPECT_EQ(static_cast<int64_t>(i), file_size);
std::optional<int64_t> file_size = base::GetFileSize(file_path);
EXPECT_TRUE(file_size.has_value());
EXPECT_EQ(static_cast<int64_t>(i), file_size.value());
}
}
@ -1306,10 +1309,10 @@ TEST_F(ZipTest, Compressed) {
// Since the source files compress well, the destination ZIP file should be
// smaller than the source files.
int64_t dest_file_size;
ASSERT_TRUE(base::GetFileSize(dest_file, &dest_file_size));
EXPECT_GT(dest_file_size, 300);
EXPECT_LT(dest_file_size, 1000);
std::optional<int64_t> dest_file_size = base::GetFileSize(dest_file);
ASSERT_TRUE(dest_file_size.has_value());
EXPECT_GT(dest_file_size.value(), 300);
EXPECT_LT(dest_file_size.value(), 1000);
}
// Tests that a ZIP put inside a ZIP is simply stored instead of being
@ -1338,10 +1341,10 @@ TEST_F(ZipTest, NestedZip) {
// Since the dummy source (inner) ZIP file should simply be stored in the
// destination (outer) ZIP file, the destination file should be bigger than
// the source file, but not much bigger.
int64_t dest_file_size;
ASSERT_TRUE(base::GetFileSize(dest_file, &dest_file_size));
EXPECT_GT(dest_file_size, src_size + 100);
EXPECT_LT(dest_file_size, src_size + 300);
std::optional<int64_t> dest_file_size = base::GetFileSize(dest_file);
ASSERT_TRUE(dest_file_size.has_value());
EXPECT_GT(dest_file_size.value(), src_size + 100);
EXPECT_LT(dest_file_size.value(), src_size + 300);
}
// Tests that there is no 2GB or 4GB limits. Tests that big files can be zipped
@ -1402,10 +1405,10 @@ TEST_F(ZipTest, BigFile) {
// Since the dummy source (inner) ZIP file should simply be stored in the
// destination (outer) ZIP file, the destination file should be bigger than
// the source file, but not much bigger.
int64_t dest_file_size;
ASSERT_TRUE(base::GetFileSize(dest_file, &dest_file_size));
EXPECT_GT(dest_file_size, src_size + 100);
EXPECT_LT(dest_file_size, src_size + 300);
std::optional<int64_t> dest_file_size = base::GetFileSize(dest_file);
ASSERT_TRUE(dest_file_size.has_value());
EXPECT_GT(dest_file_size.value(), src_size + 100);
EXPECT_LT(dest_file_size.value(), src_size + 300);
LOG(INFO) << "Reading big ZIP " << dest_file;
zip::ZipReader reader;

View File

@ -2,5 +2,5 @@
// Refer to tools/dep_updaters/update-zlib.sh
#ifndef SRC_ZLIB_VERSION_H_
#define SRC_ZLIB_VERSION_H_
#define ZLIB_VERSION "1.3.0.1-motley-71660e1"
#define ZLIB_VERSION "1.3.0.1-motley-7e2e4d7"
#endif // SRC_ZLIB_VERSION_H_