Report ZIP data descriptor write failures#381
Open
94xhn wants to merge 1 commit into
Open
Conversation
Set the archive error on short descriptor writes in both memory and read-callback writer paths. Tested: Catch2 regression; full CMake/Ninja build and CTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The two streaming ZIP writer paths returned
MZ_FALSEwhen their final data descriptor write was short, but leftmz_zip_get_last_error()atMZ_ZIP_NO_ERROR. Callers therefore received a failure result without a useful error code.Set
MZ_ZIP_FILE_WRITE_FAILEDin both the memory-input and read-callback writer paths, matching the surrounding archive write checks.Testing
mz_zip_writer_add_mem()andmz_zip_writer_add_read_buf_callback().77d0dce, both sections fail because the error remains 0 instead ofMZ_ZIP_FILE_WRITE_FAILED(exit 2).ctest --output-on-failurepassed 100%.