8000 [pull] develop from zlib-ng:develop by pull[bot] · Pull Request #6 · sysfce2/minizip · GitHub
[go: up one dir, main page]

Skip to content

[pull] develop from zlib-ng:develop - #6

Open
pull[bot] wants to merge 263 commits into
sysfce2:developfrom
zlib-ng:develop
Open

pull[bot] wants to merge 263 commits into
sysfce2:developfrom
zlib-ng:develop

Conversation

@pull
@pull pull Bot commented Oct 24, 2024 •
Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added ⤵️ pull merge-conflict Resolve conflicts manually labels Oct 24, 2024
@nmoinvaz
nmoinvaz force-pushed the develop branch 2 times, most recently from d164b07 to a6e7850 Compare November 1, 2024 23:12
nmoinvaz and others added 15 commits September 13, 2026 12:17
Contributors need to know how to run the unit tests and how pull
request formatting is checked. The readme now covers Google Test, the
ctest invocation, and the clang-format 19 check.

Assisted-By: Claude <noreply@anthropic.com>
The file table is outdated and no longer maintained. It still lists
mz_compat.* after the compatibility layer moved to compat/, and it
omits minigzip.c.

Assisted-By: Claude <noreply@anthropic.com>
Only strip a drive-letter prefix on Windows, and require the first
character to actually be a letter before treating it as one. On POSIX,
names like '/:../x' and 'W:../x' were being misidentified as drive
letters and stripped, turning an ordinary filename into a path
traversal during extraction.

Also updates the existing combine_safe test that asserted drive-letter
stripping cross-platform, since that behavior is now Windows-only by
design -- the cross-platform stripping was the vulnerability.

Credit to @SunQingyuan0 for the discovery, root-cause analysis, and
suggested fix.
Creating an archive inside a directory that is then walked, as
"minizip a.zip ." does, discovered the new archive and added it as an
entry to itself, so the file grew without bound. The writer now keeps
the resolved path of the archive and skips any file that resolves to it.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
`mz_zip_writer_open_file` stored the resolved output path before the
stream creation and open steps that can fail. A failed open followed by
`mz_zip_writer_open` on the same handle kept the stale path, and
`mz_zip_writer_add_file` then skipped a valid input that matched it.

Assisted-By: Claude <noreply@anthropic.com>
The self-inclusion tests used the default deflate method, which the
`MZ_DECOMPRESS_ONLY` build rejects with `MZ_SUPPORT_ERROR`. The tests
only care about which entries are added, so store them instead.

Assisted-By: Claude <noreply@anthropic.com>
A crypto backend is detected by the build rather than opted out of, so
it follows the HAVE_ convention of the other detected features. Builds
that don't define it now use mz_os_rand and skip entry hashing instead
of failing to link.

Assisted-By: Claude <noreply@anthropic.com>
Backend selection was spread across the Windows and Unix branches. It
is now one chain where each backend defines HAVE_CRYPT_BACKEND next to
its source file, and OpenSSL is only searched with encryption enabled,
which stops mz_crypt_rand from being defined twice in shared builds.

Assisted-By: Claude <noreply@anthropic.com>
Certificate signing and verification were removed from the reader some
time ago, but the `sign_required`, `cd_verified`, and `entry_verified`
fields remained. Nothing ever set `sign_required`, so the remaining
`MZ_SIGN_ERROR` check in `mz_zip_reader_entry_open` was unreachable.

Assisted-By: Claude <noreply@anthropic.com>
`compat/unzip.h` and `compat/zip.h` used `__has_include` unguarded,
so compilers without it, such as GCC 4.8, failed to preprocess them.
The probe is now nested under `defined(__has_include)`, as in `mz.h`.

Assisted-By: Claude <noreply@anthropic.com>
`compat/unzip.h` and `compat/zip.h` preferred `zlib-ng.h` whenever
it was on the include path. On systems that install zlib-ng's native
header next to zlib, consumers of a zlib-compat build got both headers
and failed with conflicting declarations.

The headers now include `<zlib.h>` when `ZLIB_COMPAT` is defined, and
skip the include when `zlib-ng.h` is already included. The build
exports `ZLIB_COMPAT` to consumers through CMake and the pkg-config
`Cflags` when `MZ_COMPAT` is enabled.

Assisted-By: Claude <noreply@anthropic.com>
Derive replacement central directory size from stream end
@nmoinvaz
nmoinvaz force-pushed the develop branch 2 times, most recently from a5e2eef to a570212 Compare September 16, 2026 19:49
canbolayir and others added 7 commits September 17, 2026 12:02
When the hash object cannot be allocated or the entry names an
algorithm the backend does not support, the entry was left open and
a partially initialized hash object was kept. A retry of the open
then returned success and read the entry without verification.

Route every failure after the low-level open through one cleanup
that drops the hash object and closes the entry.

Assisted-By: Claude <noreply@anthropic.com>
A hash extra field could declare a supported algorithm with any digest
length up to the buffer size. A zero length record made the comparison
on close trivially succeed, and a longer one compared uninitialized
bytes. Reject any length other than the algorithm's digest size before
the hash object is created.

Assisted-By: Claude <noreply@anthropic.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.9 to 4.38.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v4.37.9...v4.38.2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.38.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
The extra field parsers in `mz_zip_entry_read_header` read from the shared
file extra stream, so a parser that read more than its field held consumed
the next field or the comment. Each field also started wherever the
previous parser stopped.

Each field is now read through a memory stream that ends at the field's
declared length, and every field starts at its declared offset. A ZIP64
extra field is parsed at any length: a field that holds only the disk start
number is accepted, and a field that ends before a value its header marks
as present is a format error. An NTFS timestamp attribute that runs past
the end of its field is also a format error.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
`mz_stream_bzip_read` looped forever when a member's compressed data
ended before the bzip2 stream did. Once the input is exhausted,
`BZ2_bzDecompress` returns `BZ_OK` without consuming or producing
anything, which is neither the end of the stream nor an error.

A call that makes no progress now records `BZ_UNEXPECTED_EOF`, and the
read returns `MZ_DATA_ERROR`.

Builds with `HAVE_LIBCOMP` bound every entry's input to its compressed
size, so any truncated bzip2 member hung them. Other builds bound only
encrypted entries, and read an unencrypted member on past its end, so
it hung them when the file ended before the bzip2 stream.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
nmoinvaz and others added 5 commits November 2, 2026 18:24
`ubuntu-latest` now resolves to Ubuntu 26.04, which no longer packages
`clang-14` or `llvm-14`, so every job installing them fails at setup.
Those jobs now pin Ubuntu 24.04, which keeps their compiler and
coverage results unchanged.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
`ubuntu-latest` now resolves to Ubuntu 26.04, which has no `apt-key`,
so the `Clang-Format` job fails while adding the LLVM apt repository.
The job now pins Ubuntu 24.04, where that step still works.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.38.2 to 4.39.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v4.38.2...v4.39.1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.39.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: huangwenbin <huangwenbin@kylinos.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0