mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Update pathchk to reflect the fact that 1003.1-2001 now includes the
trailing null byte in PATH_MAX and _POSIX_PATH_MAX. PR: 46035
This commit is contained in:
parent
f97182acf8
commit
d241a89d5c
1 changed files with 2 additions and 0 deletions
|
|
@ -157,6 +157,8 @@ check(const char *path)
|
|||
pathmax = PATH_MAX;
|
||||
} else
|
||||
pathmax = _POSIX_PATH_MAX;
|
||||
/* PATH_MAX includes space for the trailing null byte. */
|
||||
pathmax--;
|
||||
if (pathmax != -1 && strlen(path) > (size_t)pathmax) {
|
||||
warnx("%s: path too long (limit %ld)", path, pathmax);
|
||||
goto bad;
|
||||
|
|
|
|||
Loading…
Reference in a new issue