From: Samanta Navarro Date: Sat, 28 Aug 2021 11:53:24 +0000 (+0000) Subject: Ignore size of directories with regular type X-Git-Tag: v3.6.0~56^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12d74cff72dd3505861ac1ba32deb8bd53d8bb43;p=thirdparty%2Flibarchive.git Ignore size of directories with regular type In old tar formats directories are specified by appending a slash to their names. Directories may have sizes, but they do not have data blocks. Keep this in mind and avoid skipping data blocks when encountering directories. --- diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c index 7e8febacf..18bdd9f07 100644 --- a/libarchive/archive_read_support_format_tar.c +++ b/libarchive/archive_read_support_format_tar.c @@ -573,11 +573,15 @@ archive_read_format_tar_read_header(struct archive_read *a, l = wcslen(wp); if (l > 0 && wp[l - 1] == L'/') { archive_entry_set_filetype(entry, AE_IFDIR); + tar->entry_bytes_remaining = 0; + tar->entry_padding = 0; } } else if ((p = archive_entry_pathname(entry)) != NULL) { l = strlen(p); if (l > 0 && p[l - 1] == '/') { archive_entry_set_filetype(entry, AE_IFDIR); + tar->entry_bytes_remaining = 0; + tar->entry_padding = 0; } } }