Summary: | [patch][libarchive] fix error handling in mtree parsing code | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Mark Johnston <markjdb> | ||||
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | Open --- | ||||||
Severity: | Affects Only Me | Keywords: | patch | ||||
Priority: | Normal | ||||||
Version: | Unspecified | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Mark Johnston
2010-12-14 19:40:04 UTC
Actually, I think the patch below is the proper way to handle this. Otherwise, things like an invalid type specifier (e.g. type=filee) result in the same problem as above. -Mark diff --git a/lib/libarchive/archive_read_support_format_mtree.c b/lib/libarchive/archive_read_support_format_mtree.c index 8643bb8..9295176 100644 --- a/lib/libarchive/archive_read_support_format_mtree.c +++ b/lib/libarchive/archive_read_support_format_mtree.c @@ -641,7 +641,7 @@ parse_file(struct archive_read *a, struct archive_entry *entry, archive_entry_filetype(entry) != AE_IFIFO) mismatched_type = 1; - if (mismatched_type) { + if (mismatched_type && r == ARCHIVE_OK) { if ((parsed_kws & MTREE_HAS_OPTIONAL) == 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, Responsible Changed From-To: freebsd-bugs->kientzle Over to maintainer. For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi> |