From a6b9228d3a75403a89ea3b945c2aa9d9ba368496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sat, 17 Feb 2007 11:30:00 +0000 Subject: [PATCH] (find_pa_data): if there is no list, there is no entry. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20255 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/init_creds_pw.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/krb5/init_creds_pw.c b/lib/krb5/init_creds_pw.c index 573691447..07fd3117f 100644 --- a/lib/krb5/init_creds_pw.c +++ b/lib/krb5/init_creds_pw.c @@ -836,6 +836,8 @@ static PA_DATA * find_pa_data(const METHOD_DATA *md, int type) { int i; + if (md == NULL) + return NULL; for (i = 0; i < md->len; i++) if (md->val[i].padata_type == type) return &md->val[i]; @@ -1387,8 +1389,7 @@ init_cred_loop(krb5_context context, PA_DATA *pa; size_t len; - pa = find_pa_data(rep.kdc_rep.padata, - KRB5_PADATA_CLIENT_CANONICALIZED); + pa = find_pa_data(rep.kdc_rep.padata, KRB5_PADATA_CLIENT_CANONICALIZED); if (pa == NULL) { ret = EINVAL; krb5_set_error_string(context, "Client canonicalizion not signed");