From: Jeffrey Altman Date: Mon, 16 May 2011 01:51:14 +0000 (-0400) Subject: Windows: test return from krb5_cc_start_seq_get X-Git-Tag: upstream/1.8.0_pre1^2~3743 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=76554bfc21af5df44af6c821fbed166eb66f9e53;p=packages%2Fo%2Fopenafs.git Windows: test return from krb5_cc_start_seq_get 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 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/afskfw.c b/src/WINNT/afsd/afskfw.c index a2f3d1c0f..97f19eb6e 100644 --- a/src/WINNT/afsd/afskfw.c +++ b/src/WINNT/afsd/afskfw.c @@ -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);