8131 Commits
Author SHA1 Message Date
Tobias Stoeckmann c2ebb602e9 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>
2026-07-17 17:43:15 +02:00
Tobias Stoeckmann 860365a3f0 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>
2026-07-17 17:43:15 +02:00
Tobias Stoeckmann 48e77da188 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>
2026-07-17 17:43:15 +02:00
Tobias Stoeckmann c74bb50661 Fix typos
Typos found with codespell.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-07-17 08:49:17 +02:00
Tobias Stoeckmann 8992885932 Fix typos
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-07-17 08:49:12 +02:00
Dustin L. Howett 0362c77f9f Merge pull request #3293 from DHowett/iso9660-nmlen 2026-07-16 11:10:07 -05:00
Dustin L. Howett fd36d37a6c 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.
2026-07-15 15:07:29 -05:00
Dustin L. Howett 1a9e48f6b8 iso9660: add a test for repeated long-named files blowing up RR blocks 2026-07-15 15:07:29 -05:00
datauwu 9b1746f63a xar: clean xattr checksum on encoder setup failure
Finalize the remaining xattr checksum context if encoder setup fails.
2026-07-15 22:34:03 +08:00
datauwu c318e8fac6 xar: clean xattr checksums on heap allocation failure
Finalize xattr checksum contexts if the xattr heap allocation fails.
2026-07-15 22:34:02 +08:00
datauwu 8abb31c630 xar: free virtual files on tree insert failure
Free both unlinked files when virtual-parent name generation fails.
2026-07-15 22:34:02 +08:00
datauwu 2c0d2c259e xar: clean checksums on encoder setup failure
Finalize both file checksum contexts if encoder setup fails after init.
2026-07-15 22:34:02 +08:00
datauwu 2fc84234cf xar: free write file on utility-name failure
Free the pending write file when utility name generation fails early.
2026-07-15 22:34:01 +08:00
datauwu d8040bff17 xar: free new read file when heap insertion fails
Restore the parent and free the unqueued file after heap insertion fails.
2026-07-15 22:34:01 +08:00
datauwu 2baeb07843 xar: free current read file on entry string ENOMEM
Free the popped xar_file before returning on metadata-copy ENOMEM.
2026-07-15 22:34:01 +08:00
Dustin L. Howett 87f72b5e6a Merge pull request #3243 from datauwu/tar-prefer-native-appledouble
tar: prefer multibyte pathname for AppleDouble checks
2026-07-14 14:58:23 -05:00
Dustin L. Howett bd57e425f1 Merge pull request #3290 from stoeckmann/cab_skip
cab: Check `__archive_read_consume` result
2026-07-14 14:55:29 -05:00
Tobias Stoeckmann d1c8cca883 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>
2026-07-14 20:29:55 +02:00
Dustin L. Howett 8d66ccf261 Merge pull request #3289 from uchiha-bug-hunter/pax-base64-checked-size 2026-07-14 10:44:07 -05:00
Dustin L. Howett 9e0bae9458 Merge pull request #3284 from datauwu/warc-propagate-generated-header-errors
warc: propagate generated header errors
2026-07-14 08:38:29 -05:00
Kaif Khan 992cf1fc0b pax: use checked size arithmetic in base64_encode 2026-07-14 18:46:00 +05:30
datauwu c9e90b0ba7 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.
2026-07-14 16:59:06 +08:00
Dustin L. Howett d5a15c706c Merge pull request #3264 from stoeckmann/options_const
options: Use const char pointer where possible
2026-07-13 19:22:46 -05:00
Dustin L. Howett ed6475a64c Merge pull request #3247 from stoeckmann/strnlen
Use strnlen if available
2026-07-13 19:15:34 -05:00
Dustin L. Howett a6a899d655 Merge pull request #3278 from uchiha-bug-hunter/cpio-trailer-uaf
cpio: add regression test for symlink-trailer end-of-archive check
2026-07-13 12:03:30 -05:00
Dustin L. Howett 03b665040a Merge pull request #3287 from libarchive/dependabot/github_actions/all-actions-bfcd148bc6
CI: Bump the all-actions group across 1 directory with 5 updates
2026-07-13 11:42:11 -05:00
dependabot[bot] 9fe5719d4d 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>
2026-07-13 16:13:35 +00:00
Tim Kientzle 46e9236e4e Merge pull request #3272 from daandemeyer/push-kysumqozmsuq
pax: add "align" write option for reflink-friendly archives
2026-07-13 07:53:21 -07:00
Tim Kientzle 6bbaf0ad41 Merge pull request #3286 from uchiha-bug-hunter/xar-parse-time-overread
xar: fix one-byte over-read in parse_time date parser
2026-07-13 07:36:17 -07:00
Kaif Khan 54b7f1f679 xar: fix one-byte over-read in parse_time date parser 2026-07-13 19:31:09 +05:30
datauwu 4291ca15b1 warc: clarify resource header size error
Use a more specific error when resource header generation fails.

The old message said `cannot archive file`, but this path fails when
the generated WARC resource header exceeds the internal limit.
2026-07-13 16:52:33 +08:00
datauwu aeee33085d warc: propagate generated header errors
Check generated WARC header creation and writes.

Fail when the generated warcinfo header cannot be built. Treat a
resource header build failure as fatal because output may already exist.

Propagate write errors instead of marking the record as written.
2026-07-13 16:52:31 +08:00
datauwu aefecf2fc2 warc: test generated header write errors
Add memory-writer tests for generated WARC header write failures.

Cover both the warcinfo header and a resource header with warcinfo
disabled. These tests show that header write failures are hidden.
2026-07-13 16:52:25 +08:00
Daan De Meyer 7d53dd2b49 pax: add "align" write option for reflink-friendly archives
Add a per-format "align" option to the pax writer that pads each
regular file's pax extended header (creating one if necessary) so the
file data that follows begins on a multiple of the requested number of
bytes within the uncompressed archive stream.  The value must be a
power of two and a multiple of the 512-byte tar block.

The alignment is applied to the stream feeding into any compression
filter, so the decompressed archive is aligned regardless of whether
the archive is compressed.  This lets tools share file contents out of
an (uncompressed copy of an) archive using reflinks / copy_file_range(2)
instead of doing a full data copy on extraction.

The padding is carried in an ignorable "LIBARCHIVE.pad" pax record, so
existing readers extract the archive unchanged.  Files shorter than the
alignment are left unpadded since they cannot share a whole block.

Add a test covering uncompressed and gzip-compressed archives and
document the option.

Signed-off-by: Daan De Meyer <daan@amutable.com>
2026-07-13 09:47:24 +02:00
Kaif Khan b76abee5b1 cpio: add regression test for symlink-trailer end-of-archive check
A symlink entry named TRAILER!!! with a body large enough to grow the
read filter's copy buffer used to leave the cached name pointer stale
before the end-of-archive comparison.  Read a static newc archive in
small blocks and assert the trailer is still detected (ARCHIVE_EOF).

The fix landed in 23b54da; this only adds coverage.
2026-07-13 11:44:09 +05:30
Dustin L. Howett d888c11d18 Merge pull request #3270 from daandemeyer/push-qnzponoyonzo
test_sparse_basic: avoid out-of-bounds pointer arithmetic in verify
2026-07-12 23:05:02 -05:00
Dustin L. Howett d030af0ab7 Merge pull request #3282 from datauwu/warc-reject-incomplete-resource-records
warc: reject incomplete resource records
2026-07-12 22:51:31 -05:00
Dustin L. Howett ffc377a02f Merge pull request #3285 from datauwu/uu-fix-null-memcpy-ub
uu: fix null pointer UB in EOF buffering
2026-07-12 22:20:46 -05:00
datauwu 43bb153a65 uu: fix null pointer UB in EOF buffering
The uu filter can keep a partial encoded line in its internal input
buffer, then reach upstream EOF with no new bytes available. In that
case, d is NULL and avail_in is zero, but the buffered-input path still
passes d to memcpy() before processing the saved bytes.

Skip the append copy when avail_in is zero so the saved input is handled
without passing a null source pointer to memcpy().
2026-07-12 22:04:12 +08:00
Dustin L. Howett 5d25dac1a7 Merge pull request #3277 from datauwu/cpio-fix-pointer-lifetime 2026-07-11 07:23:18 -05:00
Dustin L. Howett 4436696356 Merge pull request #3280 from stoeckmann/warc_cleanup 2026-07-11 07:17:58 -05:00
datauwu e87311a9a7 warc: reject incomplete resource records
Reject resource records when less data was written than Content-Length.

Do not append the WARC end marker after a short entry. Return fatal
because the record body has already been started.

This avoids writing a record whose length does not match its body.
2026-07-11 20:16:39 +08:00
datauwu 2e35365462 warc: test incomplete resource records
Add a writer test for a resource entry shorter than Content-Length.

The test closes after a short write and checks for a fatal error. It
documents that the end marker must not hide a short body.
2026-07-11 20:16:24 +08:00
Dustin L. Howett ade8de6f77 Merge pull request #3281 from stoeckmann/warc_bid_check 2026-07-11 07:14:05 -05:00
Tobias Stoeckmann 8e750da087 warc: Sort include headers
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-07-11 13:22:58 +02:00
Tobias Stoeckmann 7d8c565377 warc: Unify private function names
Use same style as in other format parsers.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-07-11 13:22:58 +02:00
Tobias Stoeckmann 38a4047782 warc: Use common function names
Apply same style used in other format parsers.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-07-11 13:22:58 +02:00
Tobias Stoeckmann d646e22bd8 warc: Use proper data type for unconsumed
Match other parsers and use int64_t to avoid casts and switching between
signed and unsigned.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-07-11 13:22:56 +02:00
Tobias Stoeckmann d78fea3815 warc: Simplify __archive_read_ahead check
A short read would lead to a NULL return value, thus the second check
will never be true.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-07-11 13:20:06 +02:00
Tobias Stoeckmann da33bf2d71 Merge pull request #3279 from datauwu/warc-modernize-comments
warc: modernize comments
2026-07-11 12:01:19 +02:00