]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Make sure that we consume remaining data bytes before reading
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 16 Oct 2012 07:07:47 +0000 (16:07 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 16 Oct 2012 07:07:47 +0000 (16:07 +0900)
entries in a directory in case of reading the ISO image made
by makefs.

libarchive/archive_read_support_format_iso9660.c

index b9605ac748cb577094aca35c0e81ad227732f04b..eae644e3c2d13dfee6021ecb947c167484d03877 100644 (file)
@@ -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",