mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-30 15:38:06 +01:00
Fixed execvp() of an empty pathname to fail POSIXly. Previously it
attempted to exec the components of $PATH and it usually set errno to the wrong value. Found by: NIST PCTS
This commit is contained in:
parent
1ad652a54c
commit
766631018f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19852
@ -200,6 +200,12 @@ execvp(name, argv)
|
||||
}
|
||||
bp = buf;
|
||||
|
||||
/* If it's an empty path name, fail in the usual POSIX way. */
|
||||
if (*name == '\0') {
|
||||
errno = ENOENT;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Get the path we're searching. */
|
||||
if (!(path = getenv("PATH")))
|
||||
path = _PATH_DEFPATH;
|
||||
|
Loading…
Reference in New Issue
Block a user