From: Tobias Stoeckmann Date: Sun, 22 Feb 2026 13:42:39 +0000 (+0100) Subject: libarchive: Correctly handle option failures X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34e15154562ff82ff9ea3baf9064aa3ca32b60b3;p=thirdparty%2Flibarchive.git libarchive: Correctly handle option failures If an incorrect option value has been passed to a filter, it is possible that library operations continue without even printing a warning. This can happen because the special value "ARCHIVE_WARN - 1" is only checked for filter issues, not format issues. Since this special value is larger than ARCHIVE_FAILED, such failures are silently discarded. Fix this by checking for this magic value for formats as well. Signed-off-by: Tobias Stoeckmann --- diff --git a/libarchive/archive_options.c b/libarchive/archive_options.c index 6e2c0d2a5..66491bd41 100644 --- a/libarchive/archive_options.c +++ b/libarchive/archive_options.c @@ -90,7 +90,9 @@ _archive_set_either_option(struct archive *a, const char *m, const char *o, cons if (r2 == ARCHIVE_FATAL) return (ARCHIVE_FATAL); - if (r2 == ARCHIVE_WARN - 1) + if (r1 == ARCHIVE_WARN - 1) + return r2; + if (r2 == ARCHIVE_WARN -1) return r1; return r1 > r2 ? r1 : r2; }