mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Use PATH_MAX, not MAXPATHLEN since the former is standardized.
This commit is contained in:
4
parse.c
4
parse.c
@@ -238,7 +238,7 @@ command_matches(cmnd, cmnd_args, path, sudoers_args)
|
||||
struct stat pst;
|
||||
DIR *dirp;
|
||||
struct dirent *dent;
|
||||
char buf[MAXPATHLEN];
|
||||
char buf[PATH_MAX];
|
||||
static char *cmnd_base;
|
||||
|
||||
/* Check for pseudo-commands */
|
||||
@@ -350,7 +350,7 @@ command_matches(cmnd, cmnd_args, path, sudoers_args)
|
||||
return(FALSE);
|
||||
|
||||
while ((dent = readdir(dirp)) != NULL) {
|
||||
/* ignore paths > MAXPATHLEN (XXX - log) */
|
||||
/* ignore paths > PATH_MAX (XXX - log) */
|
||||
if (strlcpy(buf, path, sizeof(buf)) >= sizeof(buf) ||
|
||||
strlcat(buf, dent->d_name, sizeof(buf)) >= sizeof(buf))
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user