From c0a7e03be880eff10ec93f7d4fcd5a2f8100be02 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 27 Jun 2008 04:47:23 +0000 Subject: [PATCH] misc uninitialized-storage accesses Fix some miscellaneous uninitialized-storage uses, mainly in unlikely error paths. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20487 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/kinit/kinit.c | 5 +++-- src/kadmin/dbutil/ovload.c | 2 +- src/lib/krb5/keytab/kt_memory.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c index 05b50bf3b..506f551c1 100644 --- a/src/clients/kinit/kinit.c +++ b/src/clients/kinit/kinit.c @@ -1,7 +1,7 @@ /* * clients/kinit/kinit.c * - * Copyright 1990 by the Massachusetts Institute of Technology. + * Copyright 1990, 2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -805,10 +805,11 @@ k5_kinit(opts, k5) if (!got_k5) return 0; + memset(&my_creds, 0, sizeof(my_creds)); + code = krb5_get_init_creds_opt_alloc(k5->ctx, &options); if (code) goto cleanup; - memset(&my_creds, 0, sizeof(my_creds)); /* From this point on, we can goto cleanup because my_creds is diff --git a/src/kadmin/dbutil/ovload.c b/src/kadmin/dbutil/ovload.c index dc1375d2c..fd5120736 100644 --- a/src/kadmin/dbutil/ovload.c +++ b/src/kadmin/dbutil/ovload.c @@ -108,7 +108,7 @@ int process_ov_principal(fname, kcontext, filep, verbose, linenop) krb5_tl_data tl_data; krb5_principal princ; krb5_db_entry kdb; - char *current; + char *current = 0; char *cp; int x, one; krb5_boolean more; diff --git a/src/lib/krb5/keytab/kt_memory.c b/src/lib/krb5/keytab/kt_memory.c index ae232801a..db392e6d5 100644 --- a/src/lib/krb5/keytab/kt_memory.c +++ b/src/lib/krb5/keytab/kt_memory.c @@ -242,6 +242,7 @@ krb5_mkt_resolve(krb5_context context, const char *name, krb5_keytab *id) err = ENOMEM; goto done; } + data->name = NULL; err = k5_mutex_init(&data->lock); if (err) { -- 2.26.2