Add check for sysconf(_SC_PAGESIZE) failure.

This commit is contained in:
Todd C. Miller
2024-01-01 11:03:01 -07:00
parent f52fa574c7
commit 00452471b1

View File

@@ -151,6 +151,8 @@ main(int argc, char *argv[])
argv += optind;
pg = (size_t)sysconf(_SC_PAGESIZE);
if (pg == (size_t)-1)
sudo_fatal("sysconf(_SC_PAGESIZE)");
if (getcwd(cwd, sizeof cwd - 1) == NULL)
sudo_fatal("getcwd");
clen = strlen(cwd);