From f2bdbda17f7426baf1ad1f9173ed198d5d8b964a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 21 Nov 2004 19:09:47 +0000 Subject: [PATCH] Zero out sd_un for each entry in sudo_defs_table in init_defaults. --- defaults.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults.c b/defaults.c index 93295a618..df8ae5db8 100644 --- a/defaults.c +++ b/defaults.c @@ -360,9 +360,9 @@ init_defaults() static int firsttime = 1; struct sudo_defs_types *def; - /* Free any strings that were set. */ + /* Clear any old settings. */ if (!firsttime) { - for (def = sudo_defs_table; def->name; def++) + for (def = sudo_defs_table; def->name; def++) { switch (def->type & T_MASK) { case T_STR: if (def->sd_un.str) { @@ -374,6 +374,8 @@ init_defaults() list_op(NULL, 0, def, freeall); break; } + memset(&def->sd_un, 0, sizeof(def->sd_un)); + } } /* First initialize the flags. */ -- 2.40.0