From: Sebastian Freundt Date: Tue, 10 Jun 2014 11:01:06 +0000 (+0000) Subject: Hygiene, protect against NULL filenames in _warc_header() X-Git-Tag: v3.1.900a~295^2^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e70844f13ed939bab77f3cd903440bcfe9adbec;p=thirdparty%2Flibarchive.git Hygiene, protect against NULL filenames in _warc_header() Return ARCHIVE_WARN immediately. --- diff --git a/libarchive/archive_write_set_format_warc.c b/libarchive/archive_write_set_format_warc.c index f16c8b1a2..cd1fde9f9 100644 --- a/libarchive/archive_write_set_format_warc.c +++ b/libarchive/archive_write_set_format_warc.c @@ -216,6 +216,12 @@ _warc_header(struct archive_write *a, struct archive_entry *entry) w->omit_warcinfo = 1U; } + if (archive_entry_pathname(entry) == NULL) { + archive_set_error(&a->archive, EINVAL, + "Invalid filename"); + return (ARCHIVE_WARN); + } + w->typ = archive_entry_filetype(entry); w->populz = 0U; if (w->typ == AE_IFREG) {