]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Hygiene, protect against NULL filenames in _warc_header()
authorSebastian Freundt <freundt@ga-group.nl>
Tue, 10 Jun 2014 11:01:06 +0000 (11:01 +0000)
committerSebastian Freundt <freundt@ga-group.nl>
Tue, 10 Jun 2014 11:01:06 +0000 (11:01 +0000)
Return ARCHIVE_WARN immediately.

libarchive/archive_write_set_format_warc.c

index f16c8b1a277a1c2fd3173f69335143658decf59e..cd1fde9f9074afe39c573a8374dbd65464365c65 100644 (file)
@@ -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) {