From babe11dab3d8aaffc86858229b2bf0232c136ed2 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 13 Jan 1994 22:59:10 +0000 Subject: [PATCH] Fixed for newly enforced memory handling convention in the Kerberos library (for the credentials structure). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3317 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb425/get_cred.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib/krb425/get_cred.c b/src/lib/krb425/get_cred.c index e0153b229..0cde5442e 100644 --- a/src/lib/krb425/get_cred.c +++ b/src/lib/krb425/get_cred.c @@ -42,11 +42,11 @@ CREDENTIALS *c; static krb5_principal client_principal = 0; krb5_creds creds; - krb5_principal server; krb5_error_code r; krb5_ticket *ticket; - if (r = krb5_build_principal(&server, + memset((char *)&creds, 0, sizeof(creds)); + if (r = krb5_build_principal(&creds.server, strlen(realm), realm, service, instance, @@ -59,14 +59,11 @@ CREDENTIALS *c; if (!client_principal) krb5_cc_get_principal(_krb425_ccache, &client_principal); - memset((char *)&creds, 0, sizeof(creds)); creds.client = client_principal; - creds.server = server; creds.times.endtime = 0; creds.keyblock.keytype = KEYTYPE_DES; r = krb5_get_credentials(0, _krb425_ccache, &creds); - krb5_free_principal(server); if (r) return(krb425error(r)); @@ -102,7 +99,7 @@ CREDENTIALS *c; } set_string(c->realm, REALM_SZ, krb5_princ_realm(creds.server)); set_string(c->service, ANAME_SZ, krb5_princ_component(creds.server, 0)); -* set_string(c->instance, INST_SZ, krb5_princ_component(creds.server, 1)); + set_string(c->instance, INST_SZ, krb5_princ_component(creds.server, 1)); c->ticket_st.length = creds.ticket.length; memcpy((char *)c->ticket_st.dat, -- 2.26.2