From: Martin Matuska Date: Thu, 16 May 2019 11:48:01 +0000 (+0200) Subject: Xar reader: do not try to add xattrs without an allocated name X-Git-Tag: v3.4.0~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1a114f9d21b5cf1df13756834d4f0f5ab4f44a7;p=thirdparty%2Flibarchive.git Xar reader: do not try to add xattrs without an allocated name Fixes #795 --- diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c index 16ccfd2ac..34253a52f 100644 --- a/libarchive/archive_read_support_format_xar.c +++ b/libarchive/archive_read_support_format_xar.c @@ -821,8 +821,18 @@ xar_read_header(struct archive_read *a, struct archive_entry *entry) r = checksum_final(a, xattr->a_sum.val, xattr->a_sum.len, xattr->e_sum.val, xattr->e_sum.len); - if (r != ARCHIVE_OK) + if (r != ARCHIVE_OK) { + archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, + "Xattr checksum error"); + r = ARCHIVE_WARN; break; + } + if (xattr->name.s == NULL) { + archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, + "Xattr name error"); + r = ARCHIVE_WARN; + break; + } archive_entry_xattr_add_entry(entry, xattr->name.s, d, outbytes); xattr = xattr->next;