misc uninitialized-storage accesses
authorKen Raeburn <raeburn@mit.edu>
Fri, 27 Jun 2008 04:47:23 +0000 (04:47 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 27 Jun 2008 04:47:23 +0000 (04:47 +0000)
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
src/kadmin/dbutil/ovload.c
src/lib/krb5/keytab/kt_memory.c

index 05b50bf3b16902e676db716fe45f8cf6d6536db2..506f551c197f593a0f01f082bc3bd04f14688be4 100644 (file)
@@ -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
index dc1375d2c95ec668290a96d89b86733189267c16..fd512073635a55d60e2b8950508fd6c5aca73880 100644 (file)
@@ -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;
index ae232801acbaa4a1c99e7f7e594161e0ea210843..db392e6d59a7b5505e064307cf5ecb212754cfd9 100644 (file)
@@ -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) {