From: Zack Weger Date: Mon, 8 Oct 2018 15:17:10 +0000 (-0400) Subject: Files with invalid names don't exist, so don't set an error X-Git-Tag: v3.6.2~30^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f0be17e48e848bc8eac4446ccd8a1b101e54e6e;p=thirdparty%2Flibarchive.git Files with invalid names don't exist, so don't set an error --- diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c index 4a2816325..3e797289e 100644 --- a/libarchive/archive_read_support_format_mtree.c +++ b/libarchive/archive_read_support_format_mtree.c @@ -1251,7 +1251,10 @@ parse_file(struct archive_read *a, struct archive_entry *entry, mtree->fd = open(path, O_RDONLY | O_BINARY | O_CLOEXEC); __archive_ensure_cloexec_flag(mtree->fd); if (mtree->fd == -1 && - (errno != ENOENT || + /* On Windows, attempting to open a file with an invalid name + * result in EINVAL (Error 22) + */ + ((errno != ENOENT && errno != EINVAL) || archive_strlen(&mtree->contents_name) > 0)) { archive_set_error(&a->archive, errno, "Can't open %s", path);