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

Zero out sd_un before calling parse_default() so we don't try

to free stack garbage in the ldap/sssd backends.
This commit is contained in:
Todd C. Miller
2016-11-08 12:58:28 -07:00
parent 738c3cbf3e
commit 1d9b8ca32e

View File

@@ -349,6 +349,7 @@ set_default(const char *var, const char *val, int op, const char *file,
int idx;
debug_decl(set_default, SUDOERS_DEBUG_DEFAULTS)
memset(&sd_un, 0, sizeof(sd_un));
idx = parse_default(var, val, op, &sd_un, file, lineno, quiet);
if (idx != -1) {
/* Set parsed value in sudo_defs_table and run callback (if any). */
@@ -372,6 +373,7 @@ set_early_default(const char *var, const char *val, int op, const char *file,
int idx;
debug_decl(set_early_default, SUDOERS_DEBUG_DEFAULTS)
memset(&sd_un, 0, sizeof(sd_un));
idx = parse_default(var, val, op, &sd_un, file, lineno, quiet);
if (idx != -1) {
/* Set parsed value in sudo_defs_table. */