krb5 commit: Fix config realm change logic in FILE remove_cred

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/e5367fcddd53dc4db0c1fd2279e91eda3791960a
commit e5367fcddd53dc4db0c1fd2279e91eda3791960a
Author: Greg Hudson <[email protected]>
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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.