From 03b531014792a6e2897558e39f330c92bcfe84b1 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Tue, 16 Oct 2012 16:07:47 +0900 Subject: [PATCH] Make sure that we consume remaining data bytes before reading entries in a directory in case of reading the ISO image made by makefs. --- libarchive/archive_read_support_format_iso9660.c | 6 ++++++ 1 file changed, 6 insertions(+) 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", -- 2.47.2