From cbe8cd315ecdcc110d9d0f431f1139d560e2beb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Podg=C3=B3rski?= Date: Sat, 25 Dec 2021 13:27:01 +0100 Subject: [PATCH 1/2] MAX_PATH=1024 --- .gitignore | 1 + src/zip.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 49b2cb2f..8a0d755a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /test/build/ /xcodeproj/ .vscode/ +Testing/ # Object files *.o diff --git a/src/zip.h b/src/zip.h index 7327d944..03296155 100644 --- a/src/zip.h +++ b/src/zip.h @@ -45,7 +45,7 @@ typedef long ssize_t; /* byte count or error */ #endif #ifndef MAX_PATH -#define MAX_PATH 32767 /* # chars in a path name including NULL */ +#define MAX_PATH 1024 /* # chars in a path name including NULL */ #endif /** From 665eb21131b4a3f5549e9e5ea70a58418e36a851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Podg=C3=B3rski?= Date: Sat, 25 Dec 2021 19:05:03 +0100 Subject: [PATCH 2/2] MZ_ZIP_MAX_IO_BUF_SIZE = 8K --- src/miniz.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/miniz.h b/src/miniz.h index ab29b114..7a244907 100644 --- a/src/miniz.h +++ b/src/miniz.h @@ -1133,7 +1133,7 @@ extern "C" { enum { /* Note: These enums can be reduced as needed to save memory or stack space - they are pretty conservative. */ - MZ_ZIP_MAX_IO_BUF_SIZE = 64 * 1024, + MZ_ZIP_MAX_IO_BUF_SIZE = 8 * 1024, MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 512, MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 512 }; @@ -8560,7 +8560,7 @@ mz_bool mz_zip_writer_add_read_buf_callback( pState = pZip->m_pState; cur_archive_file_ofs = pZip->m_archive_size; - + if ((!pState->m_zip64) && (max_size > MZ_UINT32_MAX)) { /* Source file is too large for non-zip64 */ /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */