]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix a null pointer dereference bug in ar writer.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 2 Dec 2012 10:53:27 +0000 (19:53 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 2 Dec 2012 11:09:40 +0000 (20:09 +0900)
libarchive/archive_write_set_format_ar.c

index beff49031b2352a7759573c16ae89081729e2da4..9f17564c34c34b3e5de96099a3103c8a664739f9 100644 (file)
@@ -165,7 +165,7 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry)
         * Reject files with empty name.
         */
        pathname = archive_entry_pathname(entry);
-       if (*pathname == '\0') {
+       if (pathname == NULL || *pathname == '\0') {
                archive_set_error(&a->archive, EINVAL,
                    "Invalid filename");
                return (ARCHIVE_WARN);