From: Michihiro NAKAJIMA Date: Tue, 16 Oct 2012 07:07:47 +0000 (+0900) Subject: Make sure that we consume remaining data bytes before reading X-Git-Tag: v3.1.0~40^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03b531014792a6e2897558e39f330c92bcfe84b1;p=thirdparty%2Flibarchive.git Make sure that we consume remaining data bytes before reading entries in a directory in case of reading the ISO image made by makefs. --- diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c index b9605ac74..eae644e3c 100644 --- a/libarchive/archive_read_support_format_iso9660.c +++ b/libarchive/archive_read_support_format_iso9660.c @@ -954,6 +954,12 @@ read_children(struct archive_read *a, struct file_info *parent) size_t step, skip_size; iso9660 = (struct iso9660 *)(a->format->data); + /* flush any remaining bytes from the last round to ensure + * we're positioned */ + if (iso9660->entry_bytes_unconsumed) { + __archive_read_consume(a, iso9660->entry_bytes_unconsumed); + iso9660->entry_bytes_unconsumed = 0; + } if (iso9660->current_position > parent->offset) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Ignoring out-of-order directory (%s) %jd > %jd",