Bail out if encoded "ticket" doesn't decode correctly. This allows
authorTom Yu <tlyu@mit.edu>
Tue, 4 Sep 2007 02:10:13 +0000 (02:10 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 4 Sep 2007 02:10:13 +0000 (02:10 +0000)
t_cc test case to pass and allows non-tickets to be stored (for now).

ticket: 5697

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19910 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/ccfns.c

index f44c0fe6c5c1ee1265a3407dfb103fb74cd0229b..15bc87df6b76a24e519fb5fd3bc6b952011da9b6 100644 (file)
@@ -78,7 +78,8 @@ krb5_cc_store_cred (krb5_context context, krb5_ccache cache,
      */
     s1 = creds->server;
     ret = decode_krb5_ticket(&creds->ticket, &tkt);
-    if (ret) return ret;
+    /* Bail out on errors in case someone is storing a non-ticket. */
+    if (ret) return 0;
     s2 = tkt->server;
     if (!krb5_principal_compare(context, s1, s2)) {
        creds->server = s2;