summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2016-06-28 17:12:29 +0000
committermillert <millert@openbsd.org>2016-06-28 17:12:29 +0000
commitb2969c7cce26fcf800a05bdc7ddb49f9c3ae393c (patch)
treeda65438ae44c6dc251ea6f5c4c5142d04279a224 /lib/libc
parentUse IPV6_MINHOPCOUNT to finish implementing ttl-security for IPv6. (diff)
downloadwireguard-openbsd-b2969c7cce26fcf800a05bdc7ddb49f9c3ae393c.tar.xz
wireguard-openbsd-b2969c7cce26fcf800a05bdc7ddb49f9c3ae393c.zip
Do not return an error in fts_open(3) if one of the paths in argv
is empty. Otherwise, programs using fts(3) will report an error if one of the paths is empty instead of just treating it as a non-existent file. OK guenther@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/fts.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index e042b9fe2f0..ee3a5ba2dc8 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.c,v 1.53 2015/11/01 03:45:29 guenther Exp $ */
+/* $OpenBSD: fts.c,v 1.54 2016/06/28 17:12:29 millert Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -75,7 +75,6 @@ fts_open(char * const *argv, int options,
FTSENT *p, *root;
int nitems;
FTSENT *parent, *tmp;
- size_t len;
/* Options check. */
if (options & ~FTS_OPTIONMASK) {
@@ -107,13 +106,7 @@ fts_open(char * const *argv, int options,
/* Allocate/initialize root(s). */
for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
- /* Don't allow zero-length paths. */
- if ((len = strlen(*argv)) == 0) {
- errno = ENOENT;
- goto mem3;
- }
-
- if ((p = fts_alloc(sp, *argv, len)) == NULL)
+ if ((p = fts_alloc(sp, *argv, strlen(*argv))) == NULL)
goto mem3;
p->fts_level = FTS_ROOTLEVEL;
p->fts_parent = parent;