From e077d7edbf03264570a70074f6625debe5170a6b Mon Sep 17 00:00:00 2001 From: joerg Date: Thu, 19 Jul 2018 18:04:25 +0000 Subject: [PATCH] Ignore malformed directory entries as created by Dropbox ("/"). --- usr.bin/unzip/unzip.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/usr.bin/unzip/unzip.c b/usr.bin/unzip/unzip.c index 31cc98f8aa27..3646d970d6f3 100644 --- a/usr.bin/unzip/unzip.c +++ b/usr.bin/unzip/unzip.c @@ -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 @@ -37,7 +37,7 @@ */ #include -__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 #include @@ -387,6 +387,13 @@ extract_dir(struct archive *a, struct archive_entry *e, const char *path) { 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;