10 Commits
Author SHA1 Message Date
datauwu 1c6e7b491f zip: avoid signed overflow in encrypted size checks
Avoid adding the encryption overhead directly to entry sizes when deciding
whether Zip64 is needed or when updating the stored compressed size.

For the Zip64 decision, compare against ZIP_4GB_MAX - additional_size. For
stored encrypted entries, use archive_ckd_add_i64() so the size update and
overflow check happen together.
2026-07-03 23:48:50 +08:00
datauwu aabed78710 7zip: fix SFX boundary checks
The SFX scanner missed a valid 7-Zip header when exactly 32 bytes
remained in the lookahead buffer.

The ELF SFX path also missed ".data" when it was at the last valid
position in the section string table. It also allowed e_shstrndx to be
equal to e_shnum, even though that is one past the section table.

Tighten these checks so valid edge cases are handled correctly.
2026-06-30 21:46:55 +08:00
datauwu 6333be32b8 7zip: add SFX boundary tests
Add PE and ELF SFX fixtures for the SFX scanner boundary cases.

The PE fixture places an empty 7z archive at the final exact
32-byte scan window. The ELF fixture places ".data\0" at the final
valid section string-table position.

Register the fixtures for autotools distcheck.
2026-06-30 21:46:54 +08:00
datauwu 00bafe21f1 fuzz: fix iteration comment
The fuzz test comment says each file is tested 100 times, but the
loop runs 1000 iterations. Update the comment to match the code.
2026-06-30 17:12:12 +08:00
datauwu 5e1afc9b42 zip: fix lzma/xz compression test name
The ZIP compression test name used lzmaxz even though the test covers
the LZMA and XZ compression paths. Rename it to lzma_xz.
2026-06-30 17:12:11 +08:00
datauwu e519625cf5 iso9660: fix compress test names
Several ISO tests used a bz2 suffix even though they read .Z files
and verify ARCHIVE_FILTER_COMPRESS. Rename them to use a compress
suffix so the test names match the filter.
2026-06-30 17:12:11 +08:00
datauwu ae78682a02 archive_write: group option setter tests
The write option setter checks used several tiny source files with the
same basic shape.

Keep the same DEFINE_TEST cases. Put the write-side option setter
checks in test_archive_write_set_options.c. Remove the extra source
files from the build lists.
2026-06-30 17:12:10 +08:00
datauwu 25533dd722 archive_read: group option setter tests
The read option setter checks used several tiny source files with the
same basic shape.

Keep the same DEFINE_TEST cases. Put the read-side option setter
checks in test_archive_read_set_options.c. Remove the extra source
files from the build lists.
2026-06-30 17:12:10 +08:00
datauwu d6e1e7bc3d archive_read: group close-twice tests
The close-twice read checks used three tiny source files.

Keep the same DEFINE_TEST cases. Put the fresh-object, fd-backed,
and filename-backed checks in one source file. Remove the two extra
files from the build lists.
2026-06-30 17:12:09 +08:00
data ec9d2fb992 tar reader: avoid temporary buffer for empty-prefix ustar names
For empty-prefix ustar entries, copy the fixed-width name field
directly into the archive entry instead of first building a temporary
archive_string.

This avoids a temporary buffer allocation and intermediate copy in the
common case. It also fixes a small fatal-error leak by freeing the
temporary prefix/name buffer before returning on pathname conversion
failure.
2026-06-12 15:36:28 +08:00