]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge r3722 from trunk: Fixes extraction of Zip entries that use
authorTim Kientzle <kientzle@gmail.com>
Mon, 19 Sep 2011 04:58:34 +0000 (00:58 -0400)
committerTim Kientzle <kientzle@gmail.com>
Mon, 19 Sep 2011 04:58:34 +0000 (00:58 -0400)
length-at-end without specifying either the compressed or uncompressed
length.  In particular, fixes bsdtar extraction of such files.

SVN-Revision: 3723

libarchive/archive_read_extract.c

index ea44f7b8810c65f81e1ff833cb1f009e7d580e45..0096127702b946a4d13eeb70a9ff72de033a4c9e 100644 (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);