summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2014-12-11 16:25:34 +0000
committermillert <millert@openbsd.org>2014-12-11 16:25:34 +0000
commitd0471eefe0ba11284441bbd540ebb25a5ae9cb3b (patch)
treec4b3f50d01533b76a52162148c547333b6d6e113
parentupdate to Unbound 1.5.1, ok sthen@ (diff)
downloadwireguard-openbsd-d0471eefe0ba11284441bbd540ebb25a5ae9cb3b.tar.xz
wireguard-openbsd-d0471eefe0ba11284441bbd540ebb25a5ae9cb3b.zip
Remove an undocumented limit on the length of the pattern and string
to match of PATH_MAX. As fnmatch() is used for matching more than just pathnames, this can prevent legitimate matches for long strings or partterns. OK miod@ tedu@
-rw-r--r--lib/libc/gen/fnmatch.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index 2c860f7ebf8..e83dc43c282 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fnmatch.c,v 1.17 2013/11/24 23:51:29 deraadt Exp $ */
+/* $OpenBSD: fnmatch.c,v 1.18 2014/12/11 16:25:34 millert Exp $ */
/* Copyright (c) 2011, VMware, Inc.
* All rights reserved.
@@ -88,7 +88,6 @@
#include <fnmatch.h>
#include <string.h>
#include <ctype.h>
-#include <limits.h>
#include "charclass.h"
@@ -294,10 +293,6 @@ int fnmatch(const char *pattern, const char *string, int flags)
const char *mismatch = NULL;
int matchlen = 0;
- if (strnlen(pattern, PATH_MAX) == PATH_MAX ||
- strnlen(string, PATH_MAX) == PATH_MAX)
- return (FNM_NOMATCH);
-
if (*pattern == '*')
goto firstsegment;