From 2b8d67ceb932507d5a46cafb515304364c858f57 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Thu, 14 Mar 1991 17:19:07 +0000 Subject: [PATCH] avoid bug when no addresses are present git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1917 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/gc_via_tgt.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/krb/gc_via_tgt.c b/src/lib/krb5/krb/gc_via_tgt.c index 9bc5b7e5a..badb45a8e 100644 --- a/src/lib/krb5/krb/gc_via_tgt.c +++ b/src/lib/krb5/krb/gc_via_tgt.c @@ -175,10 +175,19 @@ OLDDECLARG(krb5_creds *, cred) cred->ticket_flags = dec_rep->enc_part2->flags; cred->is_skey = FALSE; - if (retval = krb5_copy_addresses(dec_rep->enc_part2->caddrs, - &cred->addresses)) { - cleanup(); - return retval; + if (dec_rep->enc_part2->caddrs) { + if (retval = krb5_copy_addresses(dec_rep->enc_part2->caddrs, + &cred->addresses)) { + cleanup(); + return retval; + } + } else { + /* no addresses in the list means we got what we had */ + if (retval = krb5_copy_addresses(tgt->addresses, + &cred->addresses)) { + cleanup(); + return retval; + } } if (retval = krb5_copy_principal(dec_rep->enc_part2->server, &cred->server)) { -- 2.26.2