From: Tobias Stoeckmann Date: Mon, 29 Apr 2024 20:00:22 +0000 (+0200) Subject: archive_match: check archive_read_support_format_raw() return value (#2153) X-Git-Tag: v3.7.5~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ce1b4c382f96f0591ea0496af49d2f8c8f8edb8;p=thirdparty%2Flibarchive.git archive_match: check archive_read_support_format_raw() return value (#2153) If call of archive_read_support_format_raw fails, do not override the error return value with the return value of archive_read_support_format_empty(). Instead, return error code as expected. --- diff --git a/libarchive/archive_match.c b/libarchive/archive_match.c index fc8a4ce81..b108ff0a7 100644 --- a/libarchive/archive_match.c +++ b/libarchive/archive_match.c @@ -605,7 +605,8 @@ add_pattern_from_file(struct archive_match *a, struct match_list *mlist, return (ARCHIVE_FATAL); } r = archive_read_support_format_raw(ar); - r = archive_read_support_format_empty(ar); + if (r == ARCHIVE_OK) + r = archive_read_support_format_empty(ar); if (r != ARCHIVE_OK) { archive_copy_error(&(a->archive), ar); archive_read_free(ar);