krb5 commit: Fix config realm change logic in FILE remove_cred
Greg Hudson
ghudson at mit.edu
Wed Apr 17 11:35:57 EDT 2019
https://github.com/krb5/krb5/commit/e5367fcddd53dc4db0c1fd2279e91eda3791960a
commit e5367fcddd53dc4db0c1fd2279e91eda3791960a
Author: Greg Hudson <ghudson at mit.edu>
Date: Tue Apr 16 10:47:35 2019 -0400
Fix config realm change logic in FILE remove_cred
Use data_eq_string() to check the server realm, and do not check if
cred->server is NULL since it is not expected to be (and
k5_marshal_cred() would have already crashed if it were).
ticket: 8792
src/lib/krb5/ccache/cc_file.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/lib/krb5/ccache/cc_file.c b/src/lib/krb5/ccache/cc_file.c
index 91a77bf..f0f1409 100644
--- a/src/lib/krb5/ccache/cc_file.c
+++ b/src/lib/krb5/ccache/cc_file.c
@@ -1058,8 +1058,7 @@ delete_cred(krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor,
/* For config entries, also change the realm so that other implementations
* won't match them. */
- if (cred->server != NULL && cred->server->realm.length > 0 &&
- strcmp(cred->server->realm.data, "X-CACHECONF:") == 0)
+ if (data_eq_string(cred->server->realm, "X-CACHECONF:"))
memcpy(cred->server->realm.data, "X-RMED-CONF:", 12);
k5_marshal_cred(&overwrite, fcursor->version, cred);
More information about the cvs-krb5
mailing list