kadmin: list_princs zero get_opt structure before use

Not all fields are assigned to.  Initialize the structure
to zero before use.

Change-Id: I2cfc60baaf8bf80389950a373c2a82f600a71aa2
This commit is contained in:
Jeffrey Altman
2022-01-15 22:27:42 -05:00
parent 4b3f8266d7
commit a84186653c

View File

@@ -632,6 +632,7 @@ list_princs(struct list_options *opt, int argc, char **argv)
krb5_warnx(context, "programmer error: sizeof(struct get_options) != sizeof(struct list_options)"); krb5_warnx(context, "programmer error: sizeof(struct get_options) != sizeof(struct list_options)");
return 0; return 0;
} }
memset(&get_opt, 0, sizeof(get_opt));
get_opt.long_flag = opt->long_flag; get_opt.long_flag = opt->long_flag;
get_opt.short_flag = opt->short_flag; get_opt.short_flag = opt->short_flag;
get_opt.terse_flag = opt->terse_flag; get_opt.terse_flag = opt->terse_flag;