GeezerVison is showing github.com — deps: update zlib to 1.3.0.1-motley-788cb3c · nodejs/node@144bee8
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/zlib/CMakeLists.txt +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -386,6 +386,7 @@ if (BUILD_MINIZIP_BIN) | 386 | 386 | add_executable(minizip_bin contrib/minizip/minizip.c contrib/minizip/ioapi.c | 387 | 387 | contrib/minizip/ioapi.h contrib/minizip/unzip.c | 388 | 388 | contrib/minizip/unzip.h contrib/minizip/zip.c contrib/minizip/zip.h | | 389 | + contrib/minizip/ints.h contrib/minizip/skipset.h | 389 | 390 | ) | 390 | 391 | target_link_libraries(minizip_bin zlib) | 391 | 392 | endif() | |
Collapse file Copy file name to clipboardExpand all lines: deps/zlib/contrib/bench/zlib_bench.cc +6-5Lines changed: 6 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 18 | 18 | * g++|clang++ -O3 -Wall -std=c++11 zlib_bench.cc -lstdc++ -lz | 19 | 19 | */ | 20 | 20 |
| | 21 | +#include <memory.h> | | 22 | +#include <stdint.h> | | 23 | +#include <stdio.h> | | 24 | +#include <stdlib.h> | | 25 | + | 21 | 26 | #include <algorithm> | 22 | 27 | #include <chrono> | 23 | 28 | #include <fstream> | 24 | 29 | #include <memory> | | 30 | +#include <new> | 25 | 31 | #include <string> | 26 | 32 | #include <vector> | 27 | 33 |
| 28 | | -#include <memory.h> | 29 | | -#include <stdint.h> | 30 | | -#include <stdio.h> | 31 | | -#include <stdlib.h> | 32 | | - | 33 | 34 | #include "zlib.h" | 34 | 35 |
| 35 | 36 | void error_exit(const char* error, int code) { | |
Collapse file Copy file name to clipboardExpand all lines: deps/zlib/contrib/minizip/Makefile +13-5Lines changed: 13 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -CC=cc | 2 | | -CFLAGS := $(CFLAGS) -O -I../.. | | 1 | +CC?=cc | | 2 | +CFLAGS := -O $(CFLAGS) -I../.. | 3 | 3 |
| 4 | 4 | UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a | 5 | 5 | ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a | @@ -9,13 +9,21 @@ ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a | 9 | 9 |
| 10 | 10 | all: miniunz minizip | 11 | 11 |
| 12 | | -miniunz: $(UNZ_OBJS) | | 12 | +miniunz.o: miniunz.c unzip.h iowin32.h | | 13 | +minizip.o: minizip.c zip.h iowin32.h ints.h | | 14 | +unzip.o: unzip.c unzip.h crypt.h | | 15 | +zip.o: zip.c zip.h crypt.h skipset.h ints.h | | 16 | +ioapi.o: ioapi.c ioapi.h ints.h | | 17 | +iowin32.o: iowin32.c iowin32.h ioapi.h | | 18 | +mztools.o: mztools.c unzip.h | | 19 | + | | 20 | +miniunz: $(UNZ_OBJS) | 13 | 21 | $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) | 14 | 22 |
| 15 | | -minizip: $(ZIP_OBJS) | | 23 | +minizip: $(ZIP_OBJS) | 16 | 24 | $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) | 17 | 25 |
| 18 | | -test: miniunz minizip | | 26 | +test: miniunz minizip | 19 | 27 | @rm -f test.* | 20 | 28 | @echo hello hello hello > test.txt | 21 | 29 | ./minizip test test.txt | |
Collapse file Copy file name to clipboardExpand all lines: deps/zlib/contrib/minizip/README.chromium +9-2Lines changed: 9 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | Name: ZIP file API for reading file entries in a ZIP archive | 2 | 2 | Short Name: minizip | 3 | 3 | URL: https://github.com/madler/zlib/tree/master/contrib/minizip | 4 | | -Version: 1.3.0.1 | 5 | | -Revision: 643e17b7498d12ab8d15565662880579692f769d | | 4 | +Version: 1.3.1.1 | | 5 | +Revision: ef24c4c7502169f016dcd2a26923dbaf3216748c | 6 | 6 | License: Zlib | 7 | 7 | License File: //third_party/zlib/LICENSE | 8 | 8 | Shipped: yes | @@ -14,6 +14,13 @@ Minizip provides API on top of zlib that can enumerate and extract ZIP archive | 14 | 14 | files. See minizip.md for chromium build instructions. | 15 | 15 |
| 16 | 16 | Local Modifications: | | 17 | +- OS macro tweaks for Android and Fuchsia | | 18 | + 0000-build.patch (the contrib/minizip/ parts) | | 19 | + 0008-minizip-zip-unzip-tools.patch (crrev.com/886990) | | 20 | + | | 21 | +- Fix build on UWP. (crrev.com/750639) | | 22 | + 0004-fix-uwp.patch | | 23 | + | 17 | 24 | - Fixed uncompressing files with wrong uncompressed size set | 18 | 25 | crrev.com/268940 | 19 | 26 | 0014-minizip-unzip-with-incorrect-size.patch | |
Collapse file Copy file name to clipboard +57Lines changed: 57 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +/* ints.h -- create integer types for 8, 16, 32, and 64 bits | | 2 | + * Copyright (C) 2024 Mark Adler | | 3 | + * For conditions of distribution and use, see the copyright notice in zlib.h | | 4 | + * | | 5 | + * There exist compilers with limits.h, but not stdint.h or inttypes.h. | | 6 | + */ | | 7 | + | | 8 | +#ifndef INTS_H | | 9 | +#define INTS_H | | 10 | +#include <limits.h> | | 11 | +#if defined(UCHAR_MAX) && UCHAR_MAX == 0xff | | 12 | + typedef signed char i8_t; | | 13 | + typedef unsigned char ui8_t; | | 14 | +#else | | 15 | +# error "no 8-bit integer" | | 16 | +#endif | | 17 | +#if defined(USHRT_MAX) && USHRT_MAX == 0xffff | | 18 | + typedef short i16_t; | | 19 | + typedef unsigned short ui16_t; | | 20 | +#elif defined(UINT_MAX) && UINT_MAX == 0xffff | | 21 | + typedef int i16_t; | | 22 | + typedef unsigned ui16_t; | | 23 | +#else | | 24 | +# error "no 16-bit integer" | | 25 | +#endif | | 26 | +#if defined(UINT_MAX) && UINT_MAX == 0xffffffff | | 27 | + typedef int i32_t; | | 28 | + typedef unsigned ui32_t; | | 29 | +# define PI32 "d" | | 30 | +# define PUI32 "u" | | 31 | +#elif defined(ULONG_MAX) && ULONG_MAX == 0xffffffff | | 32 | + typedef long i32_t; | | 33 | + typedef unsigned long ui32_t; | | 34 | +# define PI32 "ld" | | 35 | +# define PUI32 "lu" | | 36 | +#else | | 37 | +# error "no 32-bit integer" | | 38 | +#endif | | 39 | +#if defined(ULONG_MAX) && ULONG_MAX == 0xffffffffffffffff | | 40 | + typedef long i64_t; | | 41 | + typedef unsigned long ui64_t; | | 42 | +# define PI64 "ld" | | 43 | +# define PUI64 "lu" | | 44 | +#elif defined(ULLONG_MAX) && ULLONG_MAX == 0xffffffffffffffff | | 45 | + typedef long long i64_t; | | 46 | + typedef unsigned long long ui64_t; | | 47 | +# define PI64 "lld" | | 48 | +# define PUI64 "llu" | | 49 | +#elif defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 0xffffffffffffffff | | 50 | + typedef long long i64_t; | | 51 | + typedef unsigned long long ui64_t; | | 52 | +# define PI64 "lld" | | 53 | +# define PUI64 "llu" | | 54 | +#else | | 55 | +# error "no 64-bit integer" | | 56 | +#endif | | 57 | +#endif |
Collapse file Copy file name to clipboardExpand all lines: deps/zlib/contrib/minizip/ioapi.h +4-31Lines changed: 4 additions & 31 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 18 | 18 |
| 19 | 19 | */ | 20 | 20 |
| 21 | | -#ifndef _ZLIBIOAPI64_H | 22 | | -#define _ZLIBIOAPI64_H | | 21 | +#ifndef ZLIBIOAPI64_H | | 22 | +#define ZLIBIOAPI64_H | 23 | 23 |
| 24 | 24 | #if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) | 25 | 25 |
| | 67 | 67 | #endif | 68 | 68 | #endif | 69 | 69 |
| 70 | | -/* | 71 | | -#ifndef ZPOS64_T | 72 | | - #ifdef _WIN32 | 73 | | - #define ZPOS64_T fpos_t | 74 | | - #else | 75 | | - #include <stdint.h> | 76 | | - #define ZPOS64_T uint64_t | 77 | | - #endif | 78 | | -#endif | 79 | | -*/ | 80 | | - | 81 | 70 | #ifdef HAVE_MINIZIP64_CONF_H | 82 | 71 | #include "mz64conf.h" | 83 | 72 | #endif | 84 | 73 |
| 85 | | -/* a type chosen by DEFINE */ | 86 | | -#ifdef HAVE_64BIT_INT_CUSTOM | 87 | | -typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; | 88 | | -#else | 89 | | -#ifdef HAS_STDINT_H | 90 | | -#include "stdint.h" | 91 | | -typedef uint64_t ZPOS64_T; | 92 | | -#else | 93 | | - | 94 | | - | 95 | | - | 96 | | -#if defined(_MSC_VER) || defined(__BORLANDC__) | 97 | | -typedef unsigned __int64 ZPOS64_T; | 98 | | -#else | 99 | | -typedef unsigned long long int ZPOS64_T; | 100 | | -#endif | 101 | | -#endif | 102 | | -#endif | | 74 | +#include "ints.h" | | 75 | +typedef ui64_t ZPOS64_T; | 103 | 76 |
| 104 | 77 | /* Maximum unsigned 32-bit value used as placeholder for zip64 */ | 105 | 78 | #ifndef MAXU32 | |
Collapse file Copy file name to clipboardExpand all lines: deps/zlib/contrib/minizip/iowin32.c +12-4Lines changed: 12 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -88,7 +88,7 @@ static voidpf win32_build_iowin(HANDLE hFile) { | 88 | 88 | } | 89 | 89 |
| 90 | 90 | voidpf ZCALLBACK win32_open64_file_func(voidpf opaque, const void* filename, int mode) { | 91 | | - const char* mode_fopen = NULL; | | 91 | + (void)opaque; | 92 | 92 | DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; | 93 | 93 | HANDLE hFile = NULL; | 94 | 94 |
| @@ -116,7 +116,7 @@ voidpf ZCALLBACK win32_open64_file_func(voidpf opaque, const void* filename, int | 116 | 116 |
| 117 | 117 |
| 118 | 118 | voidpf ZCALLBACK win32_open64_file_funcA(voidpf opaque, const void* filename, int mode) { | 119 | | - const char* mode_fopen = NULL; | | 119 | + (void)opaque; | 120 | 120 | DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; | 121 | 121 | HANDLE hFile = NULL; | 122 | 122 |
| @@ -139,7 +139,7 @@ voidpf ZCALLBACK win32_open64_file_funcA(voidpf opaque, const void* filename, in | 139 | 139 |
| 140 | 140 |
| 141 | 141 | voidpf ZCALLBACK win32_open64_file_funcW(voidpf opaque, const void* filename, int mode) { | 142 | | - const char* mode_fopen = NULL; | | 142 | + (void)opaque; | 143 | 143 | DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; | 144 | 144 | HANDLE hFile = NULL; | 145 | 145 |
| @@ -158,7 +158,7 @@ voidpf ZCALLBACK win32_open64_file_funcW(voidpf opaque, const void* filename, in | 158 | 158 |
| 159 | 159 |
| 160 | 160 | voidpf ZCALLBACK win32_open_file_func(voidpf opaque, const char* filename, int mode) { | 161 | | - const char* mode_fopen = NULL; | | 161 | + (void)opaque; | 162 | 162 | DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; | 163 | 163 | HANDLE hFile = NULL; | 164 | 164 |
| @@ -186,6 +186,7 @@ voidpf ZCALLBACK win32_open_file_func(voidpf opaque, const char* filename, int m | 186 | 186 |
| 187 | 187 |
| 188 | 188 | uLong ZCALLBACK win32_read_file_func(voidpf opaque, voidpf stream, void* buf,uLong size) { | | 189 | + (void)opaque; | 189 | 190 | uLong ret=0; | 190 | 191 | HANDLE hFile = NULL; | 191 | 192 | if (stream!=NULL) | @@ -207,6 +208,7 @@ uLong ZCALLBACK win32_read_file_func(voidpf opaque, voidpf stream, void* buf,uLo | 207 | 208 |
| 208 | 209 |
| 209 | 210 | uLong ZCALLBACK win32_write_file_func(voidpf opaque, voidpf stream, const void* buf, uLong size) { | | 211 | + (void)opaque; | 210 | 212 | uLong ret=0; | 211 | 213 | HANDLE hFile = NULL; | 212 | 214 | if (stream!=NULL) | @@ -246,6 +248,7 @@ static BOOL MySetFilePointerEx(HANDLE hFile, LARGE_INTEGER pos, LARGE_INTEGER *n | 246 | 248 | } | 247 | 249 |
| 248 | 250 | long ZCALLBACK win32_tell_file_func(voidpf opaque, voidpf stream) { | | 251 | + (void)opaque; | 249 | 252 | long ret=-1; | 250 | 253 | HANDLE hFile = NULL; | 251 | 254 | if (stream!=NULL) | @@ -268,6 +271,7 @@ long ZCALLBACK win32_tell_file_func(voidpf opaque, voidpf stream) { | 268 | 271 | } | 269 | 272 |
| 270 | 273 | ZPOS64_T ZCALLBACK win32_tell64_file_func(voidpf opaque, voidpf stream) { | | 274 | + (void)opaque; | 271 | 275 | ZPOS64_T ret= (ZPOS64_T)-1; | 272 | 276 | HANDLE hFile = NULL; | 273 | 277 | if (stream!=NULL) | @@ -292,6 +296,7 @@ ZPOS64_T ZCALLBACK win32_tell64_file_func(voidpf opaque, voidpf stream) { | 292 | 296 |
| 293 | 297 |
| 294 | 298 | long ZCALLBACK win32_seek_file_func(voidpf opaque, voidpf stream, uLong offset, int origin) { | | 299 | + (void)opaque; | 295 | 300 | DWORD dwMoveMethod=0xFFFFFFFF; | 296 | 301 | HANDLE hFile = NULL; | 297 | 302 |
| @@ -329,6 +334,7 @@ long ZCALLBACK win32_seek_file_func(voidpf opaque, voidpf stream, uLong offset, | 329 | 334 | } | 330 | 335 |
| 331 | 336 | long ZCALLBACK win32_seek64_file_func(voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) { | | 337 | + (void)opaque; | 332 | 338 | DWORD dwMoveMethod=0xFFFFFFFF; | 333 | 339 | HANDLE hFile = NULL; | 334 | 340 | long ret=-1; | @@ -367,6 +373,7 @@ long ZCALLBACK win32_seek64_file_func(voidpf opaque, voidpf stream, ZPOS64_T off | 367 | 373 | } | 368 | 374 |
| 369 | 375 | int ZCALLBACK win32_close_file_func(voidpf opaque, voidpf stream) { | | 376 | + (void)opaque; | 370 | 377 | int ret=-1; | 371 | 378 |
| 372 | 379 | if (stream!=NULL) | @@ -384,6 +391,7 @@ int ZCALLBACK win32_close_file_func(voidpf opaque, voidpf stream) { | 384 | 391 | } | 385 | 392 |
| 386 | 393 | int ZCALLBACK win32_error_file_func(voidpf opaque, voidpf stream) { | | 394 | + (void)opaque; | 387 | 395 | int ret=-1; | 388 | 396 | if (stream!=NULL) | 389 | 397 | { | |
Collapse file Copy file name to clipboardExpand all lines: deps/zlib/contrib/minizip/miniunz.c +24-8Lines changed: 24 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 39 | 39 | #endif | 40 | 40 |
| 41 | 41 |
| | 42 | +#ifndef _CRT_SECURE_NO_WARNINGS | | 43 | +# define _CRT_SECURE_NO_WARNINGS | | 44 | +#endif | 42 | 45 | #include <stdio.h> | 43 | 46 | #include <stdlib.h> | 44 | 47 | #include <string.h> | | 79 | 82 |
| 80 | 83 | /* change_file_date : change the date/time of a file | 81 | 84 | filename : the filename of the file where date/time must be modified | 82 | | - dosdate : the new date at the MSDos format (4 bytes) | | 85 | + dosdate : the new date at the MSDOS format (4 bytes) | 83 | 86 | tmu_date : the SAME new date at the tm_unz format */ | 84 | 87 | static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_date) { | 85 | 88 | #ifdef _WIN32 | | 89 | + (void)tmu_date; | 86 | 90 | HANDLE hFile; | 87 | 91 | FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite; | 88 | 92 |
| @@ -93,8 +97,7 @@ static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_dat | 93 | 97 | LocalFileTimeToFileTime(&ftLocal,&ftm); | 94 | 98 | SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); | 95 | 99 | CloseHandle(hFile); | 96 | | -#else | 97 | | -#if defined(unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) | | 100 | +#elif defined(__unix__) || defined(__unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) | 98 | 101 | (void)dosdate; | 99 | 102 | struct utimbuf ut; | 100 | 103 | struct tm newdate; | @@ -116,7 +119,6 @@ static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_dat | 116 | 119 | (void)dosdate; | 117 | 120 | (void)tmu_date; | 118 | 121 | #endif | 119 | | -#endif | 120 | 122 | } | 121 | 123 |
| 122 | 124 |
| @@ -125,9 +127,9 @@ static void change_file_date(const char *filename, uLong dosdate, tm_unz tmu_dat | 125 | 127 |
| 126 | 128 | static int mymkdir(const char* dirname) { | 127 | 129 | int ret=0; | 128 | | -#if defined(_WIN32) | | 130 | +#ifdef _WIN32 | 129 | 131 | ret = _mkdir(dirname); | 130 | | -#elif defined(unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) | | 132 | +#elif defined(__unix__) || defined(__unix) || defined(__APPLE__) || defined(__Fuchsia__) || defined(__ANDROID_API__) | 131 | 133 | ret = mkdir (dirname,0775); | 132 | 134 | #else | 133 | 135 | (void)dirname; | @@ -238,7 +240,7 @@ static int do_list(unzFile uf) { | 238 | 240 | printf(" ------ ------ ---- ----- ---- ---- ------ ----\n"); | 239 | 241 | for (i=0;i<gi.number_entry;i++) | 240 | 242 | { | 241 | | - char filename_inzip[256]; | | 243 | + char filename_inzip[65536+1]; | 242 | 244 | unz_file_info64 file_info; | 243 | 245 | uLong ratio=0; | 244 | 246 | const char *string_method = ""; | @@ -303,7 +305,7 @@ static int do_list(unzFile uf) { | 303 | 305 |
| 304 | 306 |
| 305 | 307 | static int do_extract_currentfile(unzFile uf, const int* popt_extract_without_path, int* popt_overwrite, const char* password) { | 306 | | - char filename_inzip[256]; | | 308 | + char filename_inzip[65536+1]; | 307 | 309 | char* filename_withoutpath; | 308 | 310 | char* p; | 309 | 311 | int err=UNZ_OK; | @@ -354,6 +356,20 @@ static int do_extract_currentfile(unzFile uf, const int* popt_extract_without_pa | 354 | 356 | else | 355 | 357 | write_filename = filename_withoutpath; | 356 | 358 |
| | 359 | + if (write_filename[0]!='\0') | | 360 | + { | | 361 | + const char* relative_check = write_filename; | | 362 | + while (relative_check[1]!='\0') | | 363 | + { | | 364 | + if (relative_check[0]=='.' && relative_check[1]=='.') | | 365 | + write_filename = relative_check; | | 366 | + relative_check++; | | 367 | + } | | 368 | + } | | 369 | + | | 370 | + while (write_filename[0]=='/' || write_filename[0]=='.') | | 371 | + write_filename++; | | 372 | + | 357 | 373 | err = unzOpenCurrentFilePassword(uf,password); | 358 | 374 | if (err!=UNZ_OK) | 359 | 375 | { | |
|