From 9bb37d675bbdaa76eed441252ff17ab5e79be484 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 15 May 2011 21:51:14 -0400 Subject: [PATCH] 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: I2218d8824af0e35392457b960f11bef970072638 Reviewed-on: http://gerrit.openafs.org/4658 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman Reviewed-on: http://gerrit.openafs.org/4673 --- src/WINNT/afsd/afskfw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WINNT/afsd/afskfw.c b/src/WINNT/afsd/afskfw.c index 0d950879e..ec6f3b365 100644 --- a/src/WINNT/afsd/afskfw.c +++ b/src/WINNT/afsd/afskfw.c @@ -770,6 +770,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 ) { @@ -1233,6 +1234,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); -- 2.39.5