]> git.ipfire.org Git - thirdparty/libarchive.git/commit
archive_read: make ARCHIVE_FATAL sticky in data-reading entry points
authorTim Kientzle <kientzle@acm.org>
Sun, 3 May 2026 22:20:33 +0000 (15:20 -0700)
committerTim Kientzle <kientzle@acm.org>
Tue, 5 May 2026 20:39:27 +0000 (13:39 -0700)
commite1f890dc62f7931d971e2483efd8a3d30a98b1f4
treeb2117a79b50975f07487bac1a4d43e1cdca57258
parente9d68b030d3ffa40402fc0f8c7ec81c5c0543c15
archive_read: make ARCHIVE_FATAL sticky in data-reading entry points

Three entry points in archive_read.c could return ARCHIVE_FATAL from
the format layer without setting a->archive.state = ARCHIVE_STATE_FATAL,
so subsequent API calls would not see the archive as fatally broken:

- archive_read_data_skip() unconditionally reset state to HEADER even
  when the format's skip returned ARCHIVE_FATAL.

- archive_seek_data() and _archive_read_data_block() forwarded FATAL
  from the format layer without recording it in the archive state.

Fix all three so that ARCHIVE_FATAL causes the state to become
ARCHIVE_STATE_FATAL, consistent with the existing behavior of
archive_read_next_header().
libarchive/archive_read.c