summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2007-12-04 06:32:12 +0000
committerkientzle <kientzle@FreeBSD.org>2007-12-04 06:32:12 +0000
commit8327024837c0e102c20438c0aae9c8ea8d8d04de (patch)
treed7dc290b862a811d7e6a384d7c33dd220ec6e0f5 /lib
parent61e8cfdeeb0711c479fcc91620b8ffc6d91902e3 (diff)
downloadFreeBSD-src-8327024837c0e102c20438c0aae9c8ea8d8d04de.zip
FreeBSD-src-8327024837c0e102c20438c0aae9c8ea8d8d04de.tar.gz
If a Zip entry has the "length at end" flag set, then just ignore
a length field of zero; it does not mean the body is empty. Thanks to: Lapo Luchini for sending me a JAR archive that demonstrated this bug MFC after: 3 days
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_read_support_format_zip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_support_format_zip.c b/lib/libarchive/archive_read_support_format_zip.c
index b07e14e..e997677 100644
--- a/lib/libarchive/archive_read_support_format_zip.c
+++ b/lib/libarchive/archive_read_support_format_zip.c
@@ -336,7 +336,8 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry,
zip->entry_offset = 0;
/* If there's no body, force read_data() to return EOF immediately. */
- if (zip->entry_bytes_remaining < 1)
+ if (0 == (zip->flags & ZIP_LENGTH_AT_END)
+ && zip->entry_bytes_remaining < 1)
zip->end_of_entry = 1;
/* Set up a more descriptive format name. */
OpenPOWER on IntegriCloud