Skip to content

Report ZIP data descriptor write failures#381

Open
94xhn wants to merge 1 commit into
richgel999:masterfrom
94xhn:fix-zip-descriptor-write-error
Open

Report ZIP data descriptor write failures#381
94xhn wants to merge 1 commit into
richgel999:masterfrom
94xhn:fix-zip-descriptor-write-error

Conversation

@94xhn

@94xhn 94xhn commented Jul 15, 2026

Copy link
Copy Markdown

Summary

The two streaming ZIP writer paths returned MZ_FALSE when their final data descriptor write was short, but left mz_zip_get_last_error() at MZ_ZIP_NO_ERROR. Callers therefore received a failure result without a useful error code.

Set MZ_ZIP_FILE_WRITE_FAILED in both the memory-input and read-callback writer paths, matching the surrounding archive write checks.

Testing

  • Added a short-write callback regression covering mz_zip_writer_add_mem() and mz_zip_writer_add_read_buf_callback().
  • Against unmodified 77d0dce, both sections fail because the error remains 0 instead of MZ_ZIP_FILE_WRITE_FAILED (exit 2).
  • With this change, the focused test passes all 10 assertions.
  • Full CMake/Ninja build completed and ctest --output-on-failure passed 100%.

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
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

Successfully merging this pull request may close these issues.

1 participant