From owner-freebsd-bugs@FreeBSD.ORG Tue Dec 14 20:20:10 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66355106566C for ; Tue, 14 Dec 2010 20:20:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 549938FC08 for ; Tue, 14 Dec 2010 20:20:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oBEKKAvw062409 for ; Tue, 14 Dec 2010 20:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oBEKKAW7062408; Tue, 14 Dec 2010 20:20:10 GMT (envelope-from gnats) Date: Tue, 14 Dec 2010 20:20:10 GMT Message-Id: <201012142020.oBEKKAW7062408@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Mark Johnston Cc: Subject: Re: bin/153154: [patch][libarchive] fix error handling in mtree parsing code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mark Johnston List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:20:10 -0000 The following reply was made to PR bin/153154; it has been noted by GNATS. From: Mark Johnston To: bug-followup@FreeBSD.org, markjdb@gmail.com Cc: Subject: Re: bin/153154: [patch][libarchive] fix error handling in mtree parsing code Date: Tue, 14 Dec 2010 15:15:57 -0500 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,