krb5 commit: Fix populate_krb5_db_entry() princ_ent init

Greg Hudson ghudson at mit.edu
Fri Feb 5 14:04:56 EST 2016


https://github.com/krb5/krb5/commit/9526953f36b39323ec07448a5f218d27c6f1c76f
commit 9526953f36b39323ec07448a5f218d27c6f1c76f
Author: Greg Hudson <ghudson at mit.edu>
Date:   Thu Feb 4 17:36:16 2016 -0500

    Fix populate_krb5_db_entry() princ_ent init
    
    The most recent commit introduced a new variable princ_ent in
    populate_krb5_db_entry().  princ_ent is cleaned up by the function's
    cleanup label, so it must be initialized before any "goto cleanup"
    statements.
    
    ticket: 5889

 src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
index 96565c8..7ba4416 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
+++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
@@ -1352,6 +1352,8 @@ populate_krb5_db_entry(krb5_context context, krb5_ldap_context *ldap_context,
     krb5_tl_data userinfo_tl_data = { NULL }, **endp, *tl;
     osa_princ_ent_rec princ_ent;
 
+    memset(&princ_ent, 0, sizeof(princ_ent));
+
     ret = krb5_copy_principal(context, princ, &entry->princ);
     if (ret)
         goto cleanup;
@@ -1458,8 +1460,6 @@ populate_krb5_db_entry(krb5_context context, krb5_ldap_context *ldap_context,
             goto cleanup;
     }
 
-    memset(&princ_ent, 0, sizeof(osa_princ_ent_rec));
-
     ret = krb5_ldap_get_string(ld, ent, "krbpwdpolicyreference", &pwdpolicydn,
                                &attr_present);
     if (ret)


More information about the cvs-krb5 mailing list