]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix a null pointer dereference bug in zip writer.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 2 Dec 2012 11:20:50 +0000 (20:20 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 2 Dec 2012 11:20:50 +0000 (20:20 +0900)
libarchive/archive_write_set_format_zip.c

index 6ec5c1997e3d1795af6a1c70de8992a549034643..974fd67e482a965cad17623ed5955e6affa4543b 100644 (file)
@@ -891,6 +891,8 @@ path_length(struct archive_entry *entry)
        type = archive_entry_filetype(entry);
        path = archive_entry_pathname(entry);
 
+       if (path == NULL)
+               return (0);
        if ((type == AE_IFDIR) & (path[strlen(path) - 1] != '/')) {
                return strlen(path) + 1;
        } else {