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 <patfbsd@davenulle.org> (freebsd-stable@)
MFC after:	1 week
This commit is contained in:
Martin Matuska 2011-12-20 20:02:07 +00:00
parent e3bf726bee
commit f873e4d1bd

View File

@ -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);