Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No switch to Zip64 if the zip file gets larger than 4 GB #332

Open
sesom42 opened this issue Jan 9, 2025 · 0 comments
Open

No switch to Zip64 if the zip file gets larger than 4 GB #332

sesom42 opened this issue Jan 9, 2025 · 0 comments

Comments

@sesom42
Copy link

sesom42 commented Jan 9, 2025

If files are added to a Zip archive using the mz_zip_writer_add_file function and the 4 GB limit is exceeded, the system does not automatically switch to Zip64. The resulting zip archive is then defective.

There is already a test in the mz_zip_writer_add_mem_ex_v2 function, but it only tests whether the 4 GB limit is exceeded by adding the header. Whether this limit is exceeded after the subsequent writing of the compressed data is no longer tested.

I use code like this:

mz_bool success = true;
success &= mz_zip_reader_init_file(&zip, pZipFileName, 0);
success &= mz_zip_writer_init_from_reader(&zip, pZipFileName);
success &= mz_zip_writer_add_file(&zip, pAliasName, pFileName, "", 0, MZ_DEFAULT_COMPRESSION);
success &= mz_zip_writer_finalize_archive(&zip);
mz_zip_writer_end(&zip);

After mz_zip_writer_finalize_archive success is false, if archive gets larger than 4 GB and the zip archive is defective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant