From: John Kohl Date: Thu, 14 Mar 1991 17:19:07 +0000 (+0000) Subject: avoid bug when no addresses are present X-Git-Tag: krb5-1.0-alpha4~55 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2b8d67ceb932507d5a46cafb515304364c858f57;p=krb5.git avoid bug when no addresses are present git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1917 dc483132-0cff-0310-8789-dd5450dbe970 --- 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)) {