From f873e4d1bddf9d9f99b799121dc72c745a974a1c Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Tue, 20 Dec 2011 20:02:07 +0000 Subject: Merge vendor revision 3723: Fixes extraction of Zip entries that use length-at-end without specifying either the compressed or uncompressed length. In particular, fixes bsdtar extraction of such files. Obtained from: http://code.google.com/p/libarchive Reported by: Patrick Lamaiziere (freebsd-stable@) MFC after: 1 week --- lib/libarchive/archive_read_extract.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c index 8ae5dec0f347..5c69f5998f58 100644 --- a/lib/libarchive/archive_read_extract.c +++ b/lib/libarchive/archive_read_extract.c @@ -108,7 +108,7 @@ archive_read_extract2(struct archive *_a, struct archive_entry *entry, if (r != ARCHIVE_OK) /* If _write_header failed, copy the error. */ archive_copy_error(&a->archive, ad); - else if (archive_entry_size(entry) > 0) + else if (!archive_entry_size_is_set(entry) || archive_entry_size(entry) > 0) /* Otherwise, pour data into the entry. */ r = copy_data(_a, ad); r2 = archive_write_finish_entry(ad); -- cgit v1.2.3