summaryrefslogtreecommitdiffstats
path: root/lib/libarchive
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-06-15 05:15:53 +0000
committerkientzle <kientzle@FreeBSD.org>2008-06-15 05:15:53 +0000
commit6d3ab1837b01faf41c5d73c87ab383b12bd6e08b (patch)
tree391f7114a3035c42371524505b4dccf99e96a971 /lib/libarchive
parent232c7b7d927774586ff5f3e4baed4d56fc617e0b (diff)
downloadFreeBSD-src-6d3ab1837b01faf41c5d73c87ab383b12bd6e08b.zip
FreeBSD-src-6d3ab1837b01faf41c5d73c87ab383b12bd6e08b.tar.gz
Fix reading TOC from zip archives with unsupported
compression. We can't read the body, but we shouldn't try to skip the body twice.
Diffstat (limited to 'lib/libarchive')
-rw-r--r--lib/libarchive/archive_read_support_format_zip.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libarchive/archive_read_support_format_zip.c b/lib/libarchive/archive_read_support_format_zip.c
index d7cd074..1ea19ab 100644
--- a/lib/libarchive/archive_read_support_format_zip.c
+++ b/lib/libarchive/archive_read_support_format_zip.c
@@ -564,8 +564,8 @@ archive_read_format_zip_read_data(struct archive_read *a,
*/
r = ARCHIVE_FATAL;
} else {
- /* We know compressed size; just skip it. */
- archive_read_format_zip_read_data_skip(a);
+ /* We can't decompress this entry, but we will
+ * be able to skip() it and try the next entry. */
r = ARCHIVE_WARN;
}
break;
@@ -747,6 +747,10 @@ archive_read_format_zip_read_data_skip(struct archive_read *a)
zip = (struct zip *)(a->format->data);
+ /* If we've already read to end of data, we're done. */
+ if (zip->end_of_entry_cleanup)
+ return (ARCHIVE_OK);
+
/*
* If the length is at the end, we have no choice but
* to decompress all the data to find the end marker.
OpenPOWER on IntegriCloud