From 5fa0b7b6ff67180e9a749542c2bc651e0a5d3c00 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 17 Jan 2022 22:59:39 -0500 Subject: [PATCH] lib/krb5: krb5_sento_context KRB5_SENDTO_DONE KRB5_SENDTO_FAILED Let the KRB5_SENDTO_DONE and KRB5_SENDTO_FAILED action states be handled by the provided switch blocks. This ensures that the 'ret' value is set appropriately before exiting the loop. Change-Id: I56f4cea83efd86203a9a7a36cf48c80f632cf779 --- lib/krb5/send_to_kdc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/krb5/send_to_kdc.c b/lib/krb5/send_to_kdc.c index c524cb16e..6b6977d3e 100644 --- a/lib/krb5/send_to_kdc.c +++ b/lib/krb5/send_to_kdc.c @@ -1180,7 +1180,7 @@ krb5_sendto_context(krb5_context context, action = KRB5_SENDTO_INITIAL; - while (action != KRB5_SENDTO_DONE && action != KRB5_SENDTO_FAILED) { + while (1) { krb5_krbhst_info *hi; switch (action) { @@ -1310,10 +1310,10 @@ krb5_sendto_context(krb5_context context, break; case KRB5_SENDTO_FAILED: ret = KRB5_KDC_UNREACH; - break; + goto out; case KRB5_SENDTO_DONE: ret = 0; - break; + goto out; default: heim_abort("invalid krb5_sendto_context state"); }