Linux execve(2) allows argv or envp to be NULL.

Add checks to make sure we don't deference a NULL pointer.
This commit is contained in:
Todd C. Miller
2022-07-14 09:29:40 -06:00
parent a5ac29219a
commit e5652fc65a
6 changed files with 64 additions and 24 deletions

View File

@@ -491,7 +491,7 @@ intercept_check_policy_req(PolicyCheckRequest *req,
size_t n;
debug_decl(intercept_check_policy_req, SUDO_DEBUG_EXEC);
if (req->command == NULL || req->n_argv == 0 || req->n_envp == 0) {
if (req->command == NULL || req->n_argv == 0) {
closure->errstr = N_("invalid PolicyCheckRequest");
goto done;
}