summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2010-03-09 18:29:57 +0000
committerkettenis <kettenis@openbsd.org>2010-03-09 18:29:57 +0000
commitb77d002fafc8b95326801c53f8a4e5eedacfb249 (patch)
treecafa5dbb0f4895407b40e8c530b0d6ce23e0ffa7
parentTweak default set selection so X sets are in the default list when (diff)
downloadwireguard-openbsd-b77d002fafc8b95326801c53f8a4e5eedacfb249.tar.xz
wireguard-openbsd-b77d002fafc8b95326801c53f8a4e5eedacfb249.zip
Don't attempt to dereference gl_pathv if the gl_pathc returned by glob(3) is
zero. ok deraadt@, millert@
-rw-r--r--usr.bin/sudo/match.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/sudo/match.c b/usr.bin/sudo/match.c
index 78c2b3e1635..71fa82224f1 100644
--- a/usr.bin/sudo/match.c
+++ b/usr.bin/sudo/match.c
@@ -465,7 +465,7 @@ command_matches_glob(sudoers_cmnd, sudoers_args)
* else return false.
*/
#define GLOB_FLAGS (GLOB_NOSORT | GLOB_MARK | GLOB_BRACE | GLOB_TILDE)
- if (glob(sudoers_cmnd, GLOB_FLAGS, NULL, &gl) != 0) {
+ if (glob(sudoers_cmnd, GLOB_FLAGS, NULL, &gl) != 0 || gl.gl_pathc == 0) {
globfree(&gl);
return(FALSE);
}