From: Michihiro NAKAJIMA Date: Sun, 2 Dec 2012 11:20:50 +0000 (+0900) Subject: Fix a null pointer dereference bug in zip writer. X-Git-Tag: v3.1.0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=272891ec66365a877d6cb508b4e51c9b81c71414;p=thirdparty%2Flibarchive.git Fix a null pointer dereference bug in zip writer. --- diff --git a/libarchive/archive_write_set_format_zip.c b/libarchive/archive_write_set_format_zip.c index 6ec5c1997..974fd67e4 100644 --- a/libarchive/archive_write_set_format_zip.c +++ b/libarchive/archive_write_set_format_zip.c @@ -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 {