]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix populate_krb5_db_entry() princ_ent init 401/head
authorGreg Hudson <ghudson@mit.edu>
Thu, 4 Feb 2016 22:36:16 +0000 (17:36 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 5 Feb 2016 18:55:17 +0000 (13:55 -0500)
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

index 96565c8bd43cb3a051c73d7d69fc331aa8003610..7ba44167daf11ccd4406efb9c874a2714aa14d0b 100644 (file)
@@ -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)