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.
This commit is contained in:
Tim Kientzle 2008-06-15 05:15:53 +00:00
parent 693f6cf97c
commit bfc29cb4d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179794

View file

@ -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.