]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
12 hours agoMerge pull request #3356 from dunhor/windows-clang-fixes master
Dustin L. Howett [Thu, 6 Aug 2026 16:38:16 +0000 (11:38 -0500)] 
Merge pull request #3356 from dunhor/windows-clang-fixes

Fix a number of Windows/clang(-cl) issues

27 hours agoMerge pull request #3341 from subotac/fix/root-absolute-path-test
Dustin L. Howett [Thu, 6 Aug 2026 01:26:26 +0000 (20:26 -0500)] 
Merge pull request #3341 from subotac/fix/root-absolute-path-test

29 hours agoFix a number of Windows/clang(-cl) issues 3356/head
Duncan Horn [Wed, 5 Aug 2026 23:44:08 +0000 (16:44 -0700)] 
Fix a number of Windows/clang(-cl) issues

2 days agoMerge pull request #3345 from PeiweiHu/peiwei_fix
Tim Kientzle [Tue, 4 Aug 2026 05:16:19 +0000 (22:16 -0700)] 
Merge pull request #3345 from PeiweiHu/peiwei_fix

Fix bsdtar’s `@archive` handling by freeing input readers after open failures and applying passphrases to the correct reader object.

3 days agoMerge pull request #3351 from stoeckmann/support_format
Dustin L. Howett [Mon, 3 Aug 2026 22:26:03 +0000 (17:26 -0500)] 
Merge pull request #3351 from stoeckmann/support_format

format: Improve format registration error handling

3 days agoformat: Unify support_format styles 3351/head
Tobias Stoeckmann [Mon, 3 Aug 2026 16:50:17 +0000 (18:50 +0200)] 
format: Unify support_format styles

Use same style across all formats for easier audits.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 days agoformat: Unify support_format error handling
Tobias Stoeckmann [Mon, 3 Aug 2026 16:43:26 +0000 (18:43 +0200)] 
format: Unify support_format error handling

Always return r to unify style for easier audits.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 days agoformat: Forward errors/warnings in support_format
Tobias Stoeckmann [Mon, 3 Aug 2026 16:32:28 +0000 (18:32 +0200)] 
format: Forward errors/warnings in support_format

If registering a format parser bidder fails or triggers a warning,
forward the information instead of silently turning it into ARCHIVE_OK.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 days agoformat: Test error handling in support_format
Tobias Stoeckmann [Mon, 3 Aug 2026 16:19:23 +0000 (18:19 +0200)] 
format: Test error handling in support_format

Make sure that all formats return a warning if registered multiple
times.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
3 days agoMerge pull request #3347 from datauwu/archive-write-share-hdrcharset
Dustin L. Howett [Mon, 3 Aug 2026 17:51:31 +0000 (12:51 -0500)] 
Merge pull request #3347 from datauwu/archive-write-share-hdrcharset

archive_write: share hdrcharset option handling

3 days agoMerge pull request #3346 from stoeckmann/append_filter_desync
Dustin L. Howett [Mon, 3 Aug 2026 17:48:35 +0000 (12:48 -0500)] 
Merge pull request #3346 from stoeckmann/append_filter_desync

Always attach filter to correct bidder

3 days agoMerge pull request #3350 from libarchive/dependabot/github_actions/all-actions-4f142db38a
Dustin L. Howett [Mon, 3 Aug 2026 17:07:32 +0000 (12:07 -0500)] 
Merge pull request #3350 from libarchive/dependabot/github_actions/all-actions-4f142db38a

CI: Bump the all-actions group with 4 updates

3 days agoCI: Bump the all-actions group with 4 updates 3350/head
dependabot[bot] [Mon, 3 Aug 2026 16:18:20 +0000 (16:18 +0000)] 
CI: Bump the all-actions group with 4 updates

Bumps the all-actions group with 4 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action).

Updates `github/codeql-action/init` from 4.37.3 to 4.37.4
- [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/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38)

Updates `github/codeql-action/autobuild` from 4.37.3 to 4.37.4
- [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/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38)

Updates `github/codeql-action/analyze` from 4.37.3 to 4.37.4
- [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/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38)

Updates `github/codeql-action/upload-sarif` from 4.37.3 to 4.37.4
- [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/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...f205ea1c3313d32999d8d6a48b4f6530d4437b38)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.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.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
3 days agoarchive_write: share hdrcharset option handling 3347/head
datauwu [Sun, 2 Aug 2026 15:30:13 +0000 (23:30 +0800)] 
archive_write: share hdrcharset option handling

Several archive writers duplicate identical hdrcharset option handling.
Share the validation and conversion logic across the affected cpio, tar,
and zip writers.

This reduces duplication without changing behavior.

4 days agoMerge pull request #3312 from datauwu/formats-use-strrchr
Dustin L. Howett [Mon, 3 Aug 2026 04:53:08 +0000 (23:53 -0500)] 
Merge pull request #3312 from datauwu/formats-use-strrchr

4 days agobsdtar: apply passphrase to appended archive reader 3345/head
Peiwei Hu [Mon, 3 Aug 2026 00:49:58 +0000 (08:49 +0800)] 
bsdtar: apply passphrase to appended archive reader

When creating an archive from an @archive argument, configure the
input reader rather than passing the output writer to
archive_read_add_passphrase(). Use the reader for error reporting as
well.

4 days agobsdtar: test passphrase for appended archives
Peiwei Hu [Mon, 3 Aug 2026 00:49:51 +0000 (08:49 +0800)] 
bsdtar: test passphrase for appended archives

Exercise --passphrase while copying entries from an encrypted
@archive into a new archive, then extract the result and verify the
copied file contents.

4 days agobsdtar: free reader after failed archive open
Peiwei Hu [Sun, 2 Aug 2026 09:41:43 +0000 (17:41 +0800)] 
bsdtar: free reader after failed archive open

append_archive_filename() returns after reporting an input archive open
failure so archive creation can continue. Release the input archive
reader before returning to avoid accumulating one reader for every
failed @archive argument.

4 days agoMerge pull request #3343 from dnelson-1901/tar-mode
Tim Kientzle [Sun, 2 Aug 2026 14:34:39 +0000 (07:34 -0700)] 
Merge pull request #3343 from dnelson-1901/tar-mode

tar: add --mode option for GNU tar compatibility

4 days agoRemove bidder name 3346/head
Tobias Stoeckmann [Sun, 2 Aug 2026 12:31:33 +0000 (14:31 +0200)] 
Remove bidder name

The name was only needed to find the appropriate bidder for a filter.
Since this has been resolved by accessing the last bidder, since in these
situations the bidder is added first, then the filter, the name is not
needed anymore.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 days agoappend_filter: Use last bidder for filter
Tobias Stoeckmann [Sun, 2 Aug 2026 12:27:17 +0000 (14:27 +0200)] 
append_filter: Use last bidder for filter

Appending a filter implies appending a bidder. Always use the last added
bidder, since it was just added. This avoids desync situations where
previously added bidders could erroneously match.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
4 days agoappend_filter: Verify that bidder and filter match
Tobias Stoeckmann [Sun, 2 Aug 2026 12:26:22 +0000 (14:26 +0200)] 
append_filter: Verify that bidder and filter match

Make sure that appending a filter always matches its supposed bidder.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
5 days agotar: handle --mode when extracting archives also 3343/head
Dan Nelson [Thu, 30 Jul 2026 14:31:57 +0000 (09:31 -0500)] 
tar: handle --mode when extracting archives also

5 days agotar: add --mode option (compatible with gnutar)
Dan Nelson [Fri, 24 Jul 2026 05:02:05 +0000 (00:02 -0500)] 
tar: add --mode option (compatible with gnutar)

5 days agoMerge pull request #3344 from datauwu/warc-fix-ub
Tim Kientzle [Sat, 1 Aug 2026 19:58:35 +0000 (12:58 -0700)] 
Merge pull request #3344 from datauwu/warc-fix-ub

warc: fix UB signed overflow in time conversion

5 days agowarc: fix UB signed overflow in time conversion 3344/head
datauwu [Sat, 1 Aug 2026 18:57:11 +0000 (02:57 +0800)] 
warc: fix UB signed overflow in time conversion

Use checked 64-bit math when timegm() is not available.
Reject values outside time_t instead of overflowing signed integers.

5 days agowarc: test future date conversion
datauwu [Sat, 1 Aug 2026 18:57:01 +0000 (02:57 +0800)] 
warc: test future date conversion

Add a WARC date after 2038 to cover the fallback time conversion.
On 64-bit time_t, it must parse as the expected Unix timestamp.

5 days agoMerge pull request #3342 from datauwu/bsdcpio-fix-ub
Tim Kientzle [Sat, 1 Aug 2026 15:54:01 +0000 (08:54 -0700)] 
Merge pull request #3342 from datauwu/bsdcpio-fix-ub

bsdcpio: fix UB signed overflow in time formatting

5 days agobsdtar: fix UB signed overflow in time formatting 3342/head
datauwu [Sat, 1 Aug 2026 11:48:39 +0000 (19:48 +0800)] 
bsdtar: fix UB signed overflow in time formatting

Use difftime() instead of changing time_t values by the half-year
range. This avoids signed overflow near the time_t limits without
changing normal output.

5 days agobsdcpio: fix UB signed overflow in time formatting
datauwu [Sat, 1 Aug 2026 11:48:38 +0000 (19:48 +0800)] 
bsdcpio: fix UB signed overflow in time formatting

Use difftime() instead of subtracting time_t values when choosing the
date format. This avoids signed overflow for far past or future
timestamps without changing normal output.

6 days agoClarify absolute path test extraction roots 3341/head
subotac [Fri, 31 Jul 2026 17:26:23 +0000 (20:26 +0300)] 
Clarify absolute path test extraction roots

6 days agoMerge pull request #3335 from jaipaulcheernam/fix/skip-ppmd8-aes256-test-without...
Dustin L. Howett [Fri, 31 Jul 2026 14:22:42 +0000 (09:22 -0500)] 
Merge pull request #3335 from jaipaulcheernam/fix/skip-ppmd8-aes256-test-without-crypto

7 days agoMerge pull request #3339 from datauwu/archive-string-fix-build
Dustin L. Howett [Thu, 30 Jul 2026 23:21:32 +0000 (18:21 -0500)] 
Merge pull request #3339 from datauwu/archive-string-fix-build

7 days agoFix absolute path test when run as root
subotac [Thu, 30 Jul 2026 15:40:17 +0000 (18:40 +0300)] 
Fix absolute path test when run as root

7 days agoarchive_string: require localcharset.h for locale_charset 3339/head
datauwu [Thu, 30 Jul 2026 08:20:51 +0000 (16:20 +0800)] 
archive_string: require localcharset.h for locale_charset

Only call locale_charset() when localcharset.h provides its declaration.

8 days agotest: skip ppmd8 aes256 streaming test when no crypto library is present 3335/head
Jaipaul Cheernam [Wed, 29 Jul 2026 13:33:10 +0000 (13:33 +0000)] 
test: skip ppmd8 aes256 streaming test when no crypto library is present

test_read_format_zip_ppmd8_aes256_streaming fails with 6 assertion
failures on systems without a crypto library (openssl/nettle/mbedtls)
because it tries to decrypt a pre-built encrypted zipx file without
checking crypto availability first.

Add the same guard used by the other encrypted zip tests in this file.

Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
9 days agoMerge pull request #3320 from carrerasdarren-cell/fix/iso9660-boot-image-size-overflow
Dustin L. Howett [Tue, 28 Jul 2026 19:32:46 +0000 (14:32 -0500)] 
Merge pull request #3320 from carrerasdarren-cell/fix/iso9660-boot-image-size-overflow

iso9660: avoid boot image block count overflow

9 days agoiso9660: avoid boot image block count overflow 3320/head
carrerasdarren-cell [Thu, 23 Jul 2026 15:21:29 +0000 (11:21 -0400)] 
iso9660: avoid boot image block count overflow

Use overflow-free ceiling division before narrowing the boot image block count to int.

Fixes #3269

10 days agoMerge pull request #3315 from datauwu/iso9660-remove-per-reader-comp-buf
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

10 days agoMerge pull request #3302 from datauwu/program-read-fix-uaf
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

10 days agoMerge pull request #3317 from stoeckmann/rar5_varint
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

10 days agoMerge pull request #3329 from dag-erling/des/xar-unsup-digest
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

10 days agoMerge pull request #3325 from tbontb-iaq/fix/seek-data-null-not-fatal
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)

10 days agoxar: Fix for unsupported digests 3329/head
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")

10 days agoMerge pull request #3322 from datauwu/warc-writer-unify
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

10 days agoMerge pull request #3328 from dag-erling/des/xar-sha2
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

10 days agoxar: Add support for SHA256 and SHA512 3328/head
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.

10 days agoMerge pull request #3327 from libarchive/dependabot/github_actions/all-actions-413c1c7ad7
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

10 days agoarchive_read: don't poison archive when seek is unsupported (fixes #3323) 3325/head
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.

10 days agoCI: Bump the all-actions group with 6 updates 3327/head
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>
10 days agowarc: name local variables 3322/head
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.

2 weeks agoiso9660: test large no-emulation boot image
carrerasdarren-cell [Thu, 23 Jul 2026 15:20:41 +0000 (11:20 -0400)] 
iso9660: test large no-emulation boot image

2 weeks agowarc: name helper functions
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.

2 weeks agowarc: name internal types and fields
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.

2 weeks agowarc: use writer callback names
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.

2 weeks agoprogram: fix dangling pointer after close 3302/head
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.

2 weeks agoprogram: test filter name after close
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().

2 weeks agoMerge pull request #3299 from datauwu/tar-read-fix-uaf
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

2 weeks agoMerge commit from fork
Dustin L. Howett [Tue, 21 Jul 2026 17:55:13 +0000 (12:55 -0500)] 
Merge commit from fork

Fix RAR seek_data cursor underflow

2 weeks agoMerge pull request #3318 from carrerasdarren-cell/fix/mac-metadata-self-copy-uaf
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

2 weeks agoarchive_entry: handle aliased Mac metadata copies 3318/head
carrerasdarren-cell [Tue, 21 Jul 2026 15:54:13 +0000 (11:54 -0400)] 
archive_entry: handle aliased Mac metadata copies

2 weeks agoarchive_entry: test aliased Mac metadata copies
carrerasdarren-cell [Tue, 21 Jul 2026 15:54:05 +0000 (11:54 -0400)] 
archive_entry: test aliased Mac metadata copies

2 weeks agoxar: use strrchr to find parent directories 3312/head
datauwu [Tue, 21 Jul 2026 09:43:15 +0000 (17:43 +0800)] 
xar: use strrchr to find parent directories

Replace the manual pathname scan with strrchr when locating the
parent directory.

2 weeks agomtree: use strrchr to find parent directories
datauwu [Tue, 21 Jul 2026 09:43:15 +0000 (17:43 +0800)] 
mtree: use strrchr to find parent directories

Replace the manual pathname scan with strrchr when locating the
parent directory.

2 weeks agomtree: use archive_string_dirname to roll back paths
datauwu [Tue, 21 Jul 2026 09:43:14 +0000 (17:43 +0800)] 
mtree: use archive_string_dirname to roll back paths

Replace the manual reverse scan with archive_string_dirname while
preserving the empty path representation.

2 weeks agoiso9660: remove per-reader zero comparison buffer 3315/head
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.

2 weeks agoMerge pull request #3316 from libarchive/dependabot/github_actions/all-actions-3c55da1aaa
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

2 weeks agorar5: Improve varint handling 3317/head
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>
2 weeks agoCI: Bump the all-actions group with 6 updates 3316/head
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>
2 weeks agoMerge pull request #3306 from stoeckmann/data
Dustin L. Howett [Mon, 20 Jul 2026 15:25:52 +0000 (10:25 -0500)] 
Merge pull request #3306 from stoeckmann/data

2 weeks agoGenerally use f for filter 3306/head
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>
2 weeks agofilter: Use f as filter variable name
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>
2 weeks agoUnify filter data access names
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>
2 weeks agoshar: Merge format setters
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>
2 weeks agoUnify filter data handling
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>
2 weeks agoUnify format data access names
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>
2 weeks agoUnify format data handling
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>
2 weeks agoMerge pull request #616 from chenxiaolong/android-utf8
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

2 weeks agoMerge pull request #3308 from datauwu/warc-reject-truncated-file-data
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

2 weeks agoMerge pull request #3309 from stoeckmann/write_huge
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

2 weeks agowrite: Use uint64_t for __archive_write_nulls 3309/head
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>
2 weeks agowrite: Do not write more than INT64_MAX bytes
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>
2 weeks agotar: Verify that huge files are not written
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>
2 weeks agowarc: reject truncated file data 3308/head
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.

2 weeks agowarc: test truncated file data
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.

2 weeks agoMerge pull request #3301 from datauwu/zip-remove-redundant-helper
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

2 weeks agoMerge pull request #3303 from datauwu/xar-write-fix-null-deref
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

2 weeks agoMerge pull request #3305 from datauwu/formats-various-cleanup
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

2 weeks agoMerge pull request #3307 from stoeckmann/warc_digit
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

2 weeks agoGuard RAR seek cursor before previous block lookup
0xmrniko [Sun, 19 Jul 2026 13:12:05 +0000 (18:42 +0530)] 
Guard RAR seek cursor before previous block lookup

2 weeks agoAdd RAR seek_data cursor regression test
0xmrniko [Sun, 19 Jul 2026 13:11:58 +0000 (18:41 +0530)] 
Add RAR seek_data cursor regression test

2 weeks agowarc: Avoid isdigit in version number check 3307/head
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>
2 weeks agopax: use memcpy for known-length path components 3305/head
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.

2 weeks agoar: use strrchr for member filenames
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.

2 weeks agorar: avoid rescanning converted path separators
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.

2 weeks agolha: use memchr to validate filenames
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.

2 weeks agoxar: fix NULL dereference on allocation failure 3303/head
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.

2 weeks agotar: fix UAF when reading GNU sparse headers 3299/head
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.

2 weeks agozip: remove redundant helper 3301/head
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.

2 weeks agotar: add GNU sparse header buffer reuse test
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.