Module Name:    src
Committed By:   joerg
Date:           Thu Jul 19 18:04:26 UTC 2018

Modified Files:
        src/usr.bin/unzip: unzip.c

Log Message:
Ignore malformed directory entries as created by Dropbox ("/").


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/unzip/unzip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.23 src/usr.bin/unzip/unzip.c:1.24
--- src/usr.bin/unzip/unzip.c:1.23	Thu Apr 20 13:11:35 2017
+++ src/usr.bin/unzip/unzip.c	Thu Jul 19 18:04:25 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: unzip.c,v 1.23 2017/04/20 13:11:35 joerg Exp $ */
+/* $NetBSD: unzip.c,v 1.24 2018/07/19 18:04:25 joerg Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 Joerg Sonnenberger <jo...@netbsd.org>
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: unzip.c,v 1.23 2017/04/20 13:11:35 joerg Exp $");
+__RCSID("$NetBSD: unzip.c,v 1.24 2018/07/19 18:04:25 joerg Exp $");
 
 #include <sys/queue.h>
 #include <sys/stat.h>
@@ -387,6 +387,13 @@ extract_dir(struct archive *a, struct ar
 {
 	int mode;
 
+	/*
+	 * Dropbox likes to create '/' directory entries, just ignore
+	 * such junk.
+	 */
+	if (*path == '\0')
+		return;
+
 	mode = archive_entry_mode(e) & 0777;
 	if (mode == 0)
 		mode = 0755;

Reply via email to