diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-03-09 18:29:58 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-03-09 18:29:58 +0000 |
commit | d2ef2c8d65cc899a78ec5ec24c7fec4b2dc23f9f (patch) | |
tree | 944d17ffda5f9f3d410c6a4733bc2bbe91e09ded | |
parent | c2cd982be8f5e20eb353b303b4a92e49cb6ed97c (diff) |
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.c | 2 |
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); } |