]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
rar5: return ARCHIVE_FAILED (not ARCHIVE_FATAL) for per-entry data errors
authorTim Kientzle <kientzle@acm.org>
Sun, 3 May 2026 22:21:21 +0000 (15:21 -0700)
committerTim Kientzle <kientzle@acm.org>
Sun, 3 May 2026 22:21:21 +0000 (15:21 -0700)
Two per-entry errors in the RAR5 data-reading path were returning
ARCHIVE_FATAL, preventing iteration over subsequent entries:

- "Reading encrypted data is not currently supported": the encryption
  is per-entry; unencrypted entries in the same archive remain readable.

- "Invalid filter encountered": a malformed filter spec in one entry
  does not make the rest of the archive unreadable.

Change both to ARCHIVE_FAILED.

libarchive/archive_read_support_format_rar5.c

index 63dd97b3008a9361802e349b1ae9bf7855668c18..9b263110c9a3d010b9f2fab1c5e274baf0d476dd 100644 (file)
@@ -3050,7 +3050,7 @@ static int parse_filter(struct archive_read* ar, const uint8_t* p) {
        {
                archive_set_error(&ar->archive, ARCHIVE_ERRNO_FILE_FORMAT,
                    "Invalid filter encountered");
-               return ARCHIVE_FATAL;
+               return ARCHIVE_FAILED;
        }
 
        /* Allocate a new filter. */
@@ -4207,7 +4207,7 @@ static int rar5_read_data(struct archive_read *a, const void **buff,
        if (rar->headers_are_encrypted || rar->cstate.data_encrypted) {
                archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
                    "Reading encrypted data is not currently supported");
-               return ARCHIVE_FATAL;
+               return ARCHIVE_FAILED;
        }
 
        if(rar->file.dir > 0) {