]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
fix another mispairing of read_ahead/consume
authorBrian Harring <ferringb@gmail.com>
Thu, 23 Sep 2010 11:06:59 +0000 (07:06 -0400)
committerBrian Harring <ferringb@gmail.com>
Thu, 23 Sep 2010 11:06:59 +0000 (07:06 -0400)
SVN-Revision: 2688

libarchive/archive_read_support_format_ar.c

index df6eb5d78d57298a9470d5cdbfe376452720a37e..a78db96af033d34e6065e6b2a5f9fc8a90f74f7d 100644 (file)
@@ -367,8 +367,6 @@ archive_read_format_ar_read_header(struct archive_read *a,
                            "Truncated input file");
                        return (ARCHIVE_FATAL);
                }
-               __archive_read_consume(a, bsd_name_length);
-
                /* Store it in the entry. */
                p = (char *)malloc(bsd_name_length + 1);
                if (p == NULL) {
@@ -378,6 +376,9 @@ archive_read_format_ar_read_header(struct archive_read *a,
                }
                strncpy(p, b, bsd_name_length);
                p[bsd_name_length] = '\0';
+
+               __archive_read_consume(a, bsd_name_length);
+
                archive_entry_copy_pathname(entry, p);
                free(p);
                return (ARCHIVE_OK);