avoid bug when no addresses are present
authorJohn Kohl <jtkohl@mit.edu>
Thu, 14 Mar 1991 17:19:07 +0000 (17:19 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 14 Mar 1991 17:19:07 +0000 (17:19 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1917 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/gc_via_tgt.c

index 9bc5b7e5a1578f7d63cd173a38702c25b8753916..badb45a8eaed226c6188e6cba58037a966b4050a 100644 (file)
@@ -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)) {