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

Fix potential NULL deref in debug code.

This commit is contained in:
Todd C. Miller
2020-09-23 08:59:18 -06:00
parent 09835b7198
commit 6f8e1b9741

View File

@@ -287,7 +287,8 @@ check_user_runchroot(void)
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
"def_runchroot %s, user_runchroot %s",
def_runchroot ? def_runchroot : "NULL", user_runchroot);
def_runchroot ? def_runchroot : "none",
user_runchroot ? user_runchroot : "none");
if (def_runchroot == NULL || (strcmp(def_runchroot, "*") != 0 &&
strcmp(def_runchroot, user_runchroot) != 0)) {
@@ -313,7 +314,8 @@ check_user_runcwd(void)
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
"def_runcwd %s, user_runcwd %s, user_cwd %s",
def_runcwd, user_runcwd, user_cwd);
def_runcwd ? def_runcwd : "none", user_runcwd ? user_runcwd : "none",
user_cwd ? user_cwd : "none");
if (strcmp(user_cwd, user_runcwd) != 0) {
if (def_runcwd == NULL || strcmp(def_runcwd, "*") != 0) {