]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: test return from krb5_cc_start_seq_get
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 16 May 2011 01:51:14 +0000 (21:51 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 18 May 2011 13:43:07 +0000 (06:43 -0700)
If krb5_cc_start_get fails when using Heimdal, the cursor
is invalid and it is not safe to pass it into subsequent
functions.

Change-Id: I65193fb63c33ddcbf741c21b40128785404ea920
Reviewed-on: http://gerrit.openafs.org/4658
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
src/WINNT/afsd/afskfw.c

index a2f3d1c0fbd5a48aa50e2aecef8a5b2f0e7f8f7d..97f19eb6ef3418986b3f426a09aa9d13a82f8581 100644 (file)
@@ -771,6 +771,7 @@ KFW_AFS_update_princ_ccache_data(krb5_context ctx, krb5_ccache cc, int lsa)
     code = pkrb5_timeofday(ctx, &now);
 
     cc_code = pkrb5_cc_start_seq_get(ctx, cc, &cur);
+    if (cc_code) goto cleanup;
 
     while (!(cc_code = pkrb5_cc_next_cred(ctx, cc, &cur, &creds))) {
         if ( creds.ticket_flags & TKT_FLG_INITIAL ) {
@@ -1234,6 +1235,7 @@ KFW_import_ccache_data(void)
         KFW_AFS_update_princ_ccache_data(ctx, cc, !strcmp(pNCi[i]->name,LSA_CCNAME));
 
         cc_code = pkrb5_cc_start_seq_get(ctx, cc, &cur);
+        if (cc_code) goto cleanup;
 
         while (!(cc_code = pkrb5_cc_next_cred(ctx, cc, &cur, &creds))) {
             krb5_data * sname = krb5_princ_name(ctx, creds.server);