From: Brian Harring Date: Thu, 23 Sep 2010 11:06:59 +0000 (-0400) Subject: fix another mispairing of read_ahead/consume X-Git-Tag: v3.0.0a~889 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cc344aa6103866190fa4f1263d1bcf2aef207fc;p=thirdparty%2Flibarchive.git fix another mispairing of read_ahead/consume SVN-Revision: 2688 --- diff --git a/libarchive/archive_read_support_format_ar.c b/libarchive/archive_read_support_format_ar.c index df6eb5d78..a78db96af 100644 --- a/libarchive/archive_read_support_format_ar.c +++ b/libarchive/archive_read_support_format_ar.c @@ -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);