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

This commit is contained in:
joerg 2018-07-19 18:04:25 +00:00
parent c99c81bb66
commit e077d7edbf
1 changed files with 9 additions and 2 deletions

View File

@ -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 <joerg@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 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;