2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Fix sudoers garbage collection and run it in policy fuzzer.

This commit is contained in:
Todd C. Miller
2021-02-14 14:01:31 -07:00
parent 5ade1c2539
commit 7f3c670a13
6 changed files with 82 additions and 14 deletions

View File

@@ -607,6 +607,7 @@ sudoers_policy_store_result(bool accepted, char *argv[], char *envp[],
command_info = calloc(55, sizeof(char *));
if (command_info == NULL)
goto oom;
sudoers_gc_add(GC_VECTOR, command_info);
if (safe_cmnd != NULL) {
command_info[info_len] = sudo_new_key_val("command", safe_cmnd);
@@ -877,10 +878,6 @@ sudoers_policy_store_result(bool accepted, char *argv[], char *envp[],
}
#endif /* HAVE_SELINUX */
/* Free on exit; they are not available in the close function. */
sudoers_gc_add(GC_VECTOR, envp);
sudoers_gc_add(GC_VECTOR, command_info);
/* Fill in exec environment info. */
*(exec_args->argv) = argv;
*(exec_args->envp) = envp;