From cd6bc5740fec249f75908716de26bf99c1115c47 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Wed, 27 Feb 1991 17:33:09 +0000 Subject: [PATCH] use memcmp in kdc_util.c use realm_compare in the transited stuff (transited still expects null-terminations...) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1816 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/kdc_util.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index 9d210e725..07a2d81e6 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -80,9 +80,11 @@ realm_compare(realmname, princ) krb5_data *realmname; krb5_principal princ; { - return(strncmp(realmname->data, krb5_princ_realm(princ)->data, - min(realmname->length, - krb5_princ_realm(princ)->length)) ? FALSE : TRUE); + if (realmname->length != krb5_princ_realm(princ)->length) + return FALSE; + return(memcmp((char *)realmname->data, + (char *)krb5_princ_realm(princ)->data, + realmname->length) ? FALSE : TRUE); } struct kparg { @@ -442,10 +444,10 @@ krb5_principal server; if(*otrans == ',') otrans++; - if(strcmp(krb5_princ_realm(client)->data,realm) == 0) + if (realm_compare(realm, client)) added = 1; - if(strcmp(krb5_princ_realm(server)->data,realm) == 0) + if(realm_compare(realm, server)) added = 1; while(*current) { -- 2.26.2