]>
git.ipfire.org Git - thirdparty/libarchive.git/log
Dustin L. Howett [Mon, 27 Jul 2026 22:12:53 +0000 (17:12 -0500)]
Merge pull request #3315 from datauwu/iso9660-remove-per-reader-comp-buf
iso9660: remove per-reader zero comparison buffer
Dustin L. Howett [Mon, 27 Jul 2026 22:12:20 +0000 (17:12 -0500)]
Merge pull request #3302 from datauwu/program-read-fix-uaf
program: fix dangling pointer after close
Dustin L. Howett [Mon, 27 Jul 2026 21:08:31 +0000 (16:08 -0500)]
Merge pull request #3317 from stoeckmann/rar5_varint
rar5: Improve varint handling
Tim Kientzle [Mon, 27 Jul 2026 19:36:40 +0000 (12:36 -0700)]
Merge pull request #3329 from dag-erling/des/xar-unsup-digest
xar: Fix for unsupported digests
Dustin L. Howett [Mon, 27 Jul 2026 19:24:12 +0000 (14:24 -0500)]
Merge pull request #3325 from tbontb-iaq/fix/seek-data-null-not-fatal
archive_read: don't poison archive when format lacks seek_data (fixes #3323)
Dag-Erling Smørgrav [Mon, 27 Jul 2026 18:57:24 +0000 (20:57 +0200)]
xar: Fix for unsupported digests
* In _checksum_init() and _checksum_final(), fail if the requested digest
is not supported (e.g. archive uses SHA256 but libarchive was compiled
without SHA256 support)
* In checksum_init(), fail with a meaningful error message if either
_checksum_init() call fails.
* In checksum_final(), simplify the logic and improve the error message.
* Make the various digest tests conditional on support for the digest
being tested.
Fixes:
6f10adcd5931 ("xar: Add support for SHA256 and SHA512")
Dustin L. Howett [Mon, 27 Jul 2026 18:43:51 +0000 (13:43 -0500)]
Merge pull request #3322 from datauwu/warc-writer-unify
warc: match other writer styles
Tim Kientzle [Mon, 27 Jul 2026 18:20:21 +0000 (11:20 -0700)]
Merge pull request #3328 from dag-erling/des/xar-sha2
xar: Add support for SHA256 and SHA512
Dag-Erling Smørgrav [Mon, 27 Jul 2026 17:20:07 +0000 (19:20 +0200)]
xar: Add support for SHA256 and SHA512
Extend the xar reader and writer to understand the SHA256 (header
cksum_alg 3, 32 bytes, style "sha256") and SHA512 (cksum_alg 4, 64
bytes, style "sha512") checksum algorithms in addition to the existing
SHA1 and MD5. These are the algorithm codes defined by the canonical
xar format, so archives written with them interoperate with Apple's xar,
pkgutil, and PackageKit.
Both the TOC ("toc-checksum") and per-file ("checksum") algorithms are
supported for writing. New algorithm handling is guarded by
ARCHIVE_HAS_SHA256 / ARCHIVE_HAS_SHA512 so builds without those digests
are unaffected. MAX_SUM_SIZE grows from 20 to 64 to hold a SHA512
digest.
Dustin L. Howett [Mon, 27 Jul 2026 17:01:12 +0000 (12:01 -0500)]
Merge pull request #3327 from libarchive/dependabot/github_actions/all-actions-
413c1c7ad7
CI: Bump the all-actions group with 6 updates
Jin [Sun, 26 Jul 2026 01:23:26 +0000 (09:23 +0800)]
archive_read: don't poison archive when seek is unsupported (fixes #3323)
3.8.8 ("make ARCHIVE_FATAL sticky in data-reading entry points",
commit
e1f890dc ) made archive_seek_data() set
a->archive.state = ARCHIVE_STATE_FATAL whenever the call returned
ARCHIVE_FATAL. That is correct for genuine I/O / parse failures
returned by a format's seek_data() implementation, but it also
poisoned the archive in two cases where seeking is simply
unsupported for the current format:
1. The seek_data == NULL branch in archive_seek_data() itself
(no format_seek_data_block registered: ustar/tar, the
streaming ZIP reader, ...).
2. rar5_seek_data() in archive_read_support_format_rar5.c, which
unconditionally returns ARCHIVE_FATAL because RAR5 is a
streaming unpacker. This was latent before 3.8.8 because
the read core did not make FATAL sticky; the stickiness
change exposed it.
Both are capability gaps, not stream corruption. ARCHIVE_FATAL
must always be sticky (it means the archive is irrecoverably
damaged), so both sites now return ARCHIVE_FAILED with an error
string instead. ARCHIVE_FAILED is recoverable: capability probes
such as
if (archive_seek_data(a, 0, SEEK_CUR) >= 0) ...
learn that seeking is unavailable while the archive remains
usable for subsequent reads. The sticky-on-genuine-FATAL part of
the original 3.8.8 change is preserved for actual ARCHIVE_FATAL
returns from a format's seek_data() implementation.
The seek_data == NULL branch also reports the condition better: a
format that never registers a seek hook is not illegal use of the
library, so the error is now ARCHIVE_ERRNO_MISC / "Cannot seek
data with this format" instead of ARCHIVE_ERRNO_PROGRAMMER /
"Internal error: No format_seek_data_block function registered".
The rar5 change also matches how the RAR4 reader already reports
the same situation (archive_read_support_format_rar.c:1339
returns ARCHIVE_FAILED for compressed RAR files).
This restores 3.8.7 behaviour for clients that probe seekability
before reading. VLC's skins2 stream extractor
(modules/stream_extractor/archive.c, archive_seek_subentry())
probes with archive_seek_data(a, 0, SEEK_CUR); on a non-seekable
format the poisoned state killed all later archive_read_data()
calls, breaking ZIP-packed .vlt skins on distributions shipping
libarchive 3.8.8.
Tests:
- test_archive_seek_data_unsupported: covers the seek_data==NULL
branch using a ustar archive.
- test_read_format_rar5_seek_data_unsupported: covers the
rar5_seek_data() branch using an existing RAR5 fixture, and
verifies the entry content with verify_data() after the probe.
Both fail on master and pass with this change.
dependabot[bot] [Mon, 27 Jul 2026 16:13:38 +0000 (16:13 +0000)]
CI: Bump the all-actions group with 6 updates
Bumps the all-actions group with 6 updates:
| Package | From | To |
| --- | --- | --- |
| [acj/freebsd-firecracker-action](https://github.com/acj/freebsd-firecracker-action) | `0.10.4` | `0.11.0` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.37.1` | `4.37.3` |
| [github/codeql-action/autobuild](https://github.com/github/codeql-action) | `4.37.1` | `4.37.3` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.37.1` | `4.37.3` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.4.3` | `2.4.4` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.37.1` | `4.37.3` |
Updates `acj/freebsd-firecracker-action` from 0.10.4 to 0.11.0
- [Release notes](https://github.com/acj/freebsd-firecracker-action/releases)
- [Commits](https://github.com/acj/freebsd-firecracker-action/compare/
0fe13161c7d388eed0570eac668e1ba8fc1f1e4e ...
e04896d2dd91f7ec7381e5f363c6fbe83ee445c3 )
Updates `github/codeql-action/init` from 4.37.1 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
7188fc363630916deb702c7fdcf4e481b751f97a ...
e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 )
Updates `github/codeql-action/autobuild` from 4.37.1 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
7188fc363630916deb702c7fdcf4e481b751f97a ...
e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 )
Updates `github/codeql-action/analyze` from 4.37.1 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
7188fc363630916deb702c7fdcf4e481b751f97a ...
e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 )
Updates `ossf/scorecard-action` from 2.4.3 to 2.4.4
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/
4eaacf0543bb3f2c246792bd56e8cdeffafb205a ...
2d1146689b8cda280b9bc96326124645441f03bc )
Updates `github/codeql-action/upload-sarif` from 4.37.1 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
7188fc363630916deb702c7fdcf4e481b751f97a ...
e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 )
---
updated-dependencies:
- dependency-name: acj/freebsd-firecracker-action
dependency-version: 0.11.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: all-actions
- dependency-name: github/codeql-action/init
dependency-version: 4.37.3
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: github/codeql-action/autobuild
dependency-version: 4.37.3
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: github/codeql-action/analyze
dependency-version: 4.37.3
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: ossf/scorecard-action
dependency-version: 2.4.4
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: github/codeql-action/upload-sarif
dependency-version: 4.37.3
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
...
Signed-off-by: dependabot[bot] <support@github.com>
datauwu [Thu, 23 Jul 2026 14:07:11 +0000 (22:07 +0800)]
warc: name local variables
Replace short local names with clear names.
Match the common writer layout and return style.
datauwu [Thu, 23 Jul 2026 14:07:11 +0000 (22:07 +0800)]
warc: name helper functions
Give private helpers clear WARC names.
Make the UUID helper return void.
datauwu [Thu, 23 Jul 2026 14:07:11 +0000 (22:07 +0800)]
warc: name internal types and fields
Replace short names with clear WARC names.
Move the header size limit to file scope.
datauwu [Thu, 23 Jul 2026 14:07:11 +0000 (22:07 +0800)]
warc: use writer callback names
Use the same callback form as other format writers.
Clean the prototypes and remove old section marks.
datauwu [Tue, 21 Jul 2026 19:12:04 +0000 (03:12 +0800)]
program: fix dangling pointer after close
Store the program filter description in the bidder state instead of the
active filter state.
The active state is freed by archive_read_close(), while the bidder state
remains valid until archive_read_free(). This keeps archive_filter_name()
from returning a dangling pointer.
datauwu [Tue, 21 Jul 2026 19:12:04 +0000 (03:12 +0800)]
program: test filter name after close
Verify that the external program filter name remains available after
archive_read_close().
Dustin L. Howett [Tue, 21 Jul 2026 18:13:03 +0000 (13:13 -0500)]
Merge pull request #3299 from datauwu/tar-read-fix-uaf
tar: fix UAF when reading GNU sparse headers
Dustin L. Howett [Tue, 21 Jul 2026 17:55:13 +0000 (12:55 -0500)]
Merge commit from fork
Fix RAR seek_data cursor underflow
Dustin L. Howett [Tue, 21 Jul 2026 17:48:06 +0000 (12:48 -0500)]
Merge pull request #3318 from carrerasdarren-cell/fix/mac-metadata-self-copy-uaf
archive_entry: handle aliased Mac metadata copies
carrerasdarren-cell [Tue, 21 Jul 2026 15:54:13 +0000 (11:54 -0400)]
archive_entry: handle aliased Mac metadata copies
carrerasdarren-cell [Tue, 21 Jul 2026 15:54:05 +0000 (11:54 -0400)]
archive_entry: test aliased Mac metadata copies
datauwu [Mon, 20 Jul 2026 14:57:55 +0000 (22:57 +0800)]
iso9660: remove per-reader zero comparison buffer
Check reserved fields by comparing adjacent bytes after confirming the
first byte is zero. This preserves the memcmp fast path and removes
2 KiB from each ISO9660 reader state.
Dustin L. Howett [Tue, 21 Jul 2026 00:36:20 +0000 (19:36 -0500)]
Merge pull request #3316 from libarchive/dependabot/github_actions/all-actions-
3c55da1aaa
CI: Bump the all-actions group with 6 updates
Tobias Stoeckmann [Mon, 20 Jul 2026 17:03:22 +0000 (19:03 +0200)]
rar5: Improve varint handling
A varint field can actually have up to 10 bytes to resemble whole 64 bit
of a value. Use checked arithmetic to detect integer overflows.
Also, treat a varint which never has a byte without continuation bit as
faulty.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
dependabot[bot] [Mon, 20 Jul 2026 16:13:42 +0000 (16:13 +0000)]
CI: Bump the all-actions group with 6 updates
Bumps the all-actions group with 6 updates:
| Package | From | To |
| --- | --- | --- |
| [acj/freebsd-firecracker-action](https://github.com/acj/freebsd-firecracker-action) | `0.10.3` | `0.10.4` |
| [actions/checkout](https://github.com/actions/checkout) | `7.0.0` | `7.0.1` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` |
| [github/codeql-action/autobuild](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.37.0` | `4.37.1` |
Updates `acj/freebsd-firecracker-action` from 0.10.3 to 0.10.4
- [Release notes](https://github.com/acj/freebsd-firecracker-action/releases)
- [Commits](https://github.com/acj/freebsd-firecracker-action/compare/
53cfec625fd81cfb34160e6d9ec19c9d9baa8adf ...
0fe13161c7d388eed0570eac668e1ba8fc1f1e4e )
Updates `actions/checkout` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/
9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 ...
3d3c42e5aac5ba805825da76410c181273ba90b1 )
Updates `github/codeql-action/init` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
99df26d4f13ea111d4ec1a7dddef6063f76b97e9 ...
7188fc363630916deb702c7fdcf4e481b751f97a )
Updates `github/codeql-action/autobuild` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
99df26d4f13ea111d4ec1a7dddef6063f76b97e9 ...
7188fc363630916deb702c7fdcf4e481b751f97a )
Updates `github/codeql-action/analyze` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
99df26d4f13ea111d4ec1a7dddef6063f76b97e9 ...
7188fc363630916deb702c7fdcf4e481b751f97a )
Updates `github/codeql-action/upload-sarif` from 4.37.0 to 4.37.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
99df26d4f13ea111d4ec1a7dddef6063f76b97e9 ...
7188fc363630916deb702c7fdcf4e481b751f97a )
---
updated-dependencies:
- dependency-name: acj/freebsd-firecracker-action
dependency-version: 0.10.4
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: actions/checkout
dependency-version: 7.0.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: github/codeql-action/init
dependency-version: 4.37.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: github/codeql-action/autobuild
dependency-version: 4.37.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: github/codeql-action/analyze
dependency-version: 4.37.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: github/codeql-action/upload-sarif
dependency-version: 4.37.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
...
Signed-off-by: dependabot[bot] <support@github.com>
Dustin L. Howett [Mon, 20 Jul 2026 15:25:52 +0000 (10:25 -0500)]
Merge pull request #3306 from stoeckmann/data
Tobias Stoeckmann [Sun, 19 Jul 2026 14:32:21 +0000 (16:32 +0200)]
Generally use f for filter
If there is no good reason to deviate from the rule, always use "f" for
filter just as we use "a" for archive.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sat, 18 Jul 2026 20:21:03 +0000 (22:21 +0200)]
filter: Use f as filter variable name
- If filter is meant, use "f" instead of "self" or "filter".
- If bidder is meant, use "b" instead of "self".
Matches writer filter style.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sat, 18 Jul 2026 19:56:05 +0000 (21:56 +0200)]
Unify filter data access names
Use "struct filter *filter" pattern, with filter being the name of the
filter. This matches the format parser pattern.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sat, 18 Jul 2026 19:22:37 +0000 (21:22 +0200)]
shar: Merge format setters
Clarify where the differences between the format setters are.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sat, 18 Jul 2026 18:54:47 +0000 (20:54 +0200)]
Unify filter data handling
- Declare access variable at the beginning
- Remove unneeded cast
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sat, 18 Jul 2026 17:39:41 +0000 (19:39 +0200)]
Unify format data access names
It's generally the pattern "struct format *format". Unify for easier
readability.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sat, 18 Jul 2026 17:09:12 +0000 (19:09 +0200)]
Unify format data handling
- Declare access variable at the beginning
- Remove unneeded cast (see warc parser, which never did it)
- Remove inline cast function
- Avoid unneeded brackets to unify style
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tim Kientzle [Sun, 19 Jul 2026 22:46:59 +0000 (15:46 -0700)]
Merge pull request #616 from chenxiaolong/android-utf8
Force UTF-8 as the default charset on Android
Tim Kientzle [Sun, 19 Jul 2026 22:33:19 +0000 (15:33 -0700)]
Merge pull request #3308 from datauwu/warc-reject-truncated-file-data
warc: reject truncated file data
Tim Kientzle [Sun, 19 Jul 2026 22:28:53 +0000 (15:28 -0700)]
Merge pull request #3309 from stoeckmann/write_huge
write: Correctly handle huge write requests
Tobias Stoeckmann [Sun, 19 Jul 2026 20:56:35 +0000 (22:56 +0200)]
write: Use uint64_t for __archive_write_nulls
Even though int64_t would be the correct data type because no more data
than INT64_MAX can be written, use the easier solution for format
writers for now.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sun, 19 Jul 2026 20:45:30 +0000 (22:45 +0200)]
write: Do not write more than INT64_MAX bytes
Never try to write more than INT64_MAX bytes to avoid integer overflows.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Sun, 19 Jul 2026 20:43:52 +0000 (22:43 +0200)]
tar: Verify that huge files are not written
Files which cannot fit into a stream should never return success, which
can happen due to truncation on 32 bit systems.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
datauwu [Sun, 19 Jul 2026 17:25:18 +0000 (01:25 +0800)]
warc: reject truncated file data
Return ARCHIVE_FATAL when EOF is reached before Content-Length.
datauwu [Sun, 19 Jul 2026 17:25:10 +0000 (01:25 +0800)]
warc: test truncated file data
Verify that a body shorter than Content-Length is rejected.
Tim Kientzle [Sun, 19 Jul 2026 15:47:07 +0000 (08:47 -0700)]
Merge pull request #3301 from datauwu/zip-remove-redundant-helper
zip: remove redundant helper
Tim Kientzle [Sun, 19 Jul 2026 15:41:27 +0000 (08:41 -0700)]
Merge pull request #3303 from datauwu/xar-write-fix-null-deref
xar: fix NULL dereference on allocation failure
Tim Kientzle [Sun, 19 Jul 2026 15:39:55 +0000 (08:39 -0700)]
Merge pull request #3305 from datauwu/formats-various-cleanup
formats: simplify string handling
Tim Kientzle [Sun, 19 Jul 2026 15:03:20 +0000 (08:03 -0700)]
Merge pull request #3307 from stoeckmann/warc_digit
warc: Avoid `isdigit` in version number check
0xmrniko [Sun, 19 Jul 2026 13:12:05 +0000 (18:42 +0530)]
Guard RAR seek cursor before previous block lookup
0xmrniko [Sun, 19 Jul 2026 13:11:58 +0000 (18:41 +0530)]
Add RAR seek_data cursor regression test
Tobias Stoeckmann [Sun, 19 Jul 2026 11:42:53 +0000 (13:42 +0200)]
warc: Avoid isdigit in version number check
The isdigit function is locale-dependent, which means that characters
outside of 0-9 range can return true here, e.g. "power of 2" for a few
locales on Windows.
Test for ASCII character range from '0' to '9' instead.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
datauwu [Sat, 18 Jul 2026 19:17:30 +0000 (03:17 +0800)]
pax: use memcpy for known-length path components
Use memcpy() for path components whose lengths are already known and
write the terminating null byte explicitly.
Cache the inserted component length instead of calculating it multiple
times while constructing the ustar pathname.
datauwu [Sat, 18 Jul 2026 19:10:37 +0000 (03:10 +0800)]
ar: use strrchr for member filenames
Replace the single-use basename helper with strrchr() and preserve the
existing rejection of pathnames ending in a slash.
Cache the member filename length to avoid repeated strlen() calls while
building and writing the archive header.
datauwu [Sat, 18 Jul 2026 19:07:34 +0000 (03:07 +0800)]
rar: avoid rescanning converted path separators
Continue searching after each replaced backslash instead of restarting
from the beginning of the filename.
This avoids repeatedly scanning the already converted prefix.
datauwu [Sat, 18 Jul 2026 19:07:34 +0000 (03:07 +0800)]
lha: use memchr to validate filenames
Replace the bytewise filename scan with memchr() when checking for the
invalid 0xff byte.
The search remains bounded by the filename length.
datauwu [Sat, 18 Jul 2026 16:28:32 +0000 (00:28 +0800)]
xar: fix NULL dereference on allocation failure
Check the allocation used to initialize cur_dirstr before accessing the
buffer.
Release the partially initialized strings, root entry, file registry,
and hardlink registry before returning ARCHIVE_FATAL.
datauwu [Sat, 18 Jul 2026 07:48:44 +0000 (15:48 +0800)]
tar: fix UAF when reading GNU sparse headers
Copy the old GNU tar header before reading sparse extension blocks.
Those reads may replace or free the callback buffer backing the original
header. Use the copy when parsing the common header fields.
datauwu [Sat, 18 Jul 2026 11:08:44 +0000 (19:08 +0800)]
zip: remove redundant helper
Calculate the pathname length directly after validating the path.
The helper only wrapped strlen() and adjusted the length for directory
entries. Removing it keeps the calculation beside the validation and
reuses the existing file type value.
datauwu [Sat, 18 Jul 2026 07:48:44 +0000 (15:48 +0800)]
tar: add GNU sparse header buffer reuse test
Add a test archive that reuses one read buffer for every 512-byte block.
Reading the sparse extension overwrites the main GNU header. Check that
mode, uid, gid, and mtime still come from the original header.
Dustin L. Howett [Fri, 17 Jul 2026 22:51:23 +0000 (17:51 -0500)]
Merge pull request #3292 from datauwu/xar-fix-mem-leaks
xar: fix several memory leaks
Dustin L. Howett [Fri, 17 Jul 2026 20:17:29 +0000 (15:17 -0500)]
Merge pull request #3297 from datauwu/archive-write-fix-uaf
archive_write: fix UAF when switching formats
Dustin L. Howett [Fri, 17 Jul 2026 19:06:56 +0000 (14:06 -0500)]
Merge pull request #3294 from datauwu/bsdtar-fix-signed-overflow
Dustin L. Howett [Fri, 17 Jul 2026 19:04:59 +0000 (14:04 -0500)]
Merge pull request #3296 from stoeckmann/filter_writer
datauwu [Thu, 16 Jul 2026 14:04:27 +0000 (22:04 +0800)]
bsdtar: remove tar_i64toa()
Format integer values directly at each call site and remove the custom
integer formatter.
This handles the full signed integer range and preserves unsigned byte
counters.
datauwu [Fri, 17 Jul 2026 16:18:28 +0000 (00:18 +0800)]
archive_write: fix UAF when switching formats
Clear format state and callbacks after running the previous format
destructor so a failed replacement setup cannot leave stale pointers.
Also unregister previous GNU tar state and require ARCHIVE_STATE_NEW
before switching to GNU tar.
Dustin L. Howett [Fri, 17 Jul 2026 17:03:55 +0000 (12:03 -0500)]
Merge pull request #3295 from stoeckmann/typos_2
Fix typos
Tobias Stoeckmann [Fri, 17 Jul 2026 15:41:09 +0000 (17:41 +0200)]
uuencode: Fix typo
Add missing "encode" to magic error message.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Fri, 17 Jul 2026 15:40:21 +0000 (17:40 +0200)]
filter: Unify add_filter style
This makes it easier to spot differences, which might require more
attention.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Fri, 17 Jul 2026 15:38:52 +0000 (17:38 +0200)]
filter: Check __archive_write_allocate_filter result
If allocation of filter fails, gracefully handle it instead of
eventually triggering a NULL pointer dereference.
Allocate the filter in last step, because it's rather difficult to
cleanly revert in case of error.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Fri, 17 Jul 2026 15:28:35 +0000 (17:28 +0200)]
xz: Merge more common code into common_setup
Reduces complexity of individual functions.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Fri, 17 Jul 2026 15:22:14 +0000 (17:22 +0200)]
filter: Simplify archive handling
Use archive for magic check and logging directly.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Fri, 17 Jul 2026 15:20:50 +0000 (17:20 +0200)]
compress: Allocate data while adding filter
This syncs compress write filter with other write filters.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
datauwu [Fri, 17 Jul 2026 16:05:01 +0000 (00:05 +0800)]
archive_write: test format switch UAF cleanup
Test that unregistering 7-Zip and XAR clears format state and is safe
to repeat.
Also test switching from 7-Zip to GNU tar and selecting GNU tar again.
Tobias Stoeckmann [Fri, 17 Jul 2026 15:18:06 +0000 (17:18 +0200)]
filter: Set function pointers in add_filter
Set function pointers in add filter functions, not in open.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Fri, 17 Jul 2026 15:13:36 +0000 (17:13 +0200)]
filter: Free data in its own function
Create free_data function for later reusing.
Also make sure that f->data is always set to NULL.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Fri, 17 Jul 2026 15:08:13 +0000 (17:08 +0200)]
filter: Do not set filter data redundantly
There is no need to assign fields again if they do not change.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Thu, 16 Jul 2026 20:48:36 +0000 (22:48 +0200)]
Fix typos
Typos found with codespell.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Tobias Stoeckmann [Thu, 16 Jul 2026 20:48:19 +0000 (22:48 +0200)]
Fix typos
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Dustin L. Howett [Thu, 16 Jul 2026 16:10:07 +0000 (11:10 -0500)]
Merge pull request #3293 from DHowett/iso9660-nmlen
Dustin L. Howett [Wed, 15 Jul 2026 19:59:31 +0000 (14:59 -0500)]
iso9660: always recalculate remaining extra space writing multi-part NM
Writing an iso archive with a series of long names in it would eventually
cause an out-of-bounds write off the end of the rockridge extra data.
This happened when we allocated a net-new block for a file with a name
longer than would fit in two records spanning multiple blocks. We would:
- Fill up the extra_space in the last block
- Allocate a new block
- Write 250 + 5 (header) bytes of the name into it
- Try to copy 250 _more_ bytes out of the name, even if we did not have
space left.
Dustin L. Howett [Wed, 15 Jul 2026 19:57:25 +0000 (14:57 -0500)]
iso9660: add a test for repeated long-named files blowing up RR blocks
datauwu [Wed, 15 Jul 2026 14:34:03 +0000 (22:34 +0800)]
xar: clean xattr checksum on encoder setup failure
Finalize the remaining xattr checksum context if encoder setup fails.
datauwu [Wed, 15 Jul 2026 14:34:02 +0000 (22:34 +0800)]
xar: clean xattr checksums on heap allocation failure
Finalize xattr checksum contexts if the xattr heap allocation fails.
datauwu [Wed, 15 Jul 2026 14:34:02 +0000 (22:34 +0800)]
xar: free virtual files on tree insert failure
Free both unlinked files when virtual-parent name generation fails.
datauwu [Wed, 15 Jul 2026 14:34:02 +0000 (22:34 +0800)]
xar: clean checksums on encoder setup failure
Finalize both file checksum contexts if encoder setup fails after init.
datauwu [Wed, 15 Jul 2026 14:34:01 +0000 (22:34 +0800)]
xar: free write file on utility-name failure
Free the pending write file when utility name generation fails early.
datauwu [Wed, 15 Jul 2026 14:34:01 +0000 (22:34 +0800)]
xar: free new read file when heap insertion fails
Restore the parent and free the unqueued file after heap insertion fails.
datauwu [Wed, 15 Jul 2026 14:34:01 +0000 (22:34 +0800)]
xar: free current read file on entry string ENOMEM
Free the popped xar_file before returning on metadata-copy ENOMEM.
Dustin L. Howett [Tue, 14 Jul 2026 19:58:23 +0000 (14:58 -0500)]
Merge pull request #3243 from datauwu/tar-prefer-native-appledouble
tar: prefer multibyte pathname for AppleDouble checks
Dustin L. Howett [Tue, 14 Jul 2026 19:55:29 +0000 (14:55 -0500)]
Merge pull request #3290 from stoeckmann/cab_skip
cab: Check `__archive_read_consume` result
Tobias Stoeckmann [Tue, 14 Jul 2026 18:29:55 +0000 (20:29 +0200)]
cab: Check __archive_read_consume result
The bytes were not previously read, so check result of
__archive_read_consume.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Dustin L. Howett [Tue, 14 Jul 2026 15:44:07 +0000 (10:44 -0500)]
Merge pull request #3289 from uchiha-bug-hunter/pax-base64-checked-size
Dustin L. Howett [Tue, 14 Jul 2026 13:38:29 +0000 (08:38 -0500)]
Merge pull request #3284 from datauwu/warc-propagate-generated-header-errors
warc: propagate generated header errors
Kaif Khan [Tue, 14 Jul 2026 13:16:00 +0000 (18:46 +0530)]
pax: use checked size arithmetic in base64_encode
datauwu [Tue, 14 Jul 2026 08:59:06 +0000 (16:59 +0800)]
tar: prefer multibyte pathname for AppleDouble checks
AppleDouble detection only needs to inspect the final path component for
the "._" prefix.
Check the multibyte pathname first on all platforms and only fall back to
WCS when the multibyte pathname is unavailable. This avoids unnecessary
wide-character pathname conversion for ordinary tar entries when mac-ext
handling is enabled.
Entries without an available pathname now return no match instead of
ARCHIVE_FAILED from the boolean check.
Dustin L. Howett [Tue, 14 Jul 2026 00:22:46 +0000 (19:22 -0500)]
Merge pull request #3264 from stoeckmann/options_const
options: Use const char pointer where possible
Dustin L. Howett [Tue, 14 Jul 2026 00:15:34 +0000 (19:15 -0500)]
Merge pull request #3247 from stoeckmann/strnlen
Use strnlen if available
Dustin L. Howett [Mon, 13 Jul 2026 17:03:30 +0000 (12:03 -0500)]
Merge pull request #3278 from uchiha-bug-hunter/cpio-trailer-uaf
cpio: add regression test for symlink-trailer end-of-archive check
Dustin L. Howett [Mon, 13 Jul 2026 16:42:11 +0000 (11:42 -0500)]
Merge pull request #3287 from libarchive/dependabot/github_actions/all-actions-
bfcd148bc6
CI: Bump the all-actions group across 1 directory with 5 updates
dependabot[bot] [Mon, 13 Jul 2026 16:13:35 +0000 (16:13 +0000)]
CI: Bump the all-actions group across 1 directory with 5 updates
Bumps the all-actions group with 5 updates in the / directory:
| Package | From | To |
| --- | --- | --- |
| [acj/freebsd-firecracker-action](https://github.com/acj/freebsd-firecracker-action) | `0.10.1` | `0.10.3` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.36.2` | `4.37.0` |
| [github/codeql-action/autobuild](https://github.com/github/codeql-action) | `4.36.2` | `4.37.0` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.36.2` | `4.37.0` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.36.2` | `4.37.0` |
Updates `acj/freebsd-firecracker-action` from 0.10.1 to 0.10.3
- [Release notes](https://github.com/acj/freebsd-firecracker-action/releases)
- [Commits](https://github.com/acj/freebsd-firecracker-action/compare/
da029f050a7a2535fce96385727cf3d5768bd8bf ...
53cfec625fd81cfb34160e6d9ec19c9d9baa8adf )
Updates `github/codeql-action/init` from 4.36.2 to 4.37.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
8aad20d150bbac5944a9f9d289da16a4b0d87c1e ...
99df26d4f13ea111d4ec1a7dddef6063f76b97e9 )
Updates `github/codeql-action/autobuild` from 4.36.2 to 4.37.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
8aad20d150bbac5944a9f9d289da16a4b0d87c1e ...
99df26d4f13ea111d4ec1a7dddef6063f76b97e9 )
Updates `github/codeql-action/analyze` from 4.36.2 to 4.37.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
8aad20d150bbac5944a9f9d289da16a4b0d87c1e ...
99df26d4f13ea111d4ec1a7dddef6063f76b97e9 )
Updates `github/codeql-action/upload-sarif` from 4.36.2 to 4.37.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/
8aad20d150bbac5944a9f9d289da16a4b0d87c1e ...
99df26d4f13ea111d4ec1a7dddef6063f76b97e9 )
---
updated-dependencies:
- dependency-name: acj/freebsd-firecracker-action
dependency-version: 0.10.3
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: all-actions
- dependency-name: github/codeql-action/init
dependency-version: 4.37.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: all-actions
- dependency-name: github/codeql-action/autobuild
dependency-version: 4.37.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: all-actions
- dependency-name: github/codeql-action/analyze
dependency-version: 4.37.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: all-actions
- dependency-name: github/codeql-action/upload-sarif
dependency-version: 4.37.0
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: all-actions
...
Signed-off-by: dependabot[bot] <support@github.com>
Tim Kientzle [Mon, 13 Jul 2026 14:53:21 +0000 (07:53 -0700)]
Merge pull request #3272 from daandemeyer/push-kysumqozmsuq
pax: add "align" write option for reflink-friendly archives