From: John Kohl Date: Wed, 27 Feb 1991 10:57:21 +0000 (+0000) Subject: oops, need to compare lengths first.. X-Git-Tag: krb5-1.0-alpha4~178 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7753738488ba43cb7f98ecfafde7540458187152;p=krb5.git oops, need to compare lengths first.. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1794 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/princ_comp.c b/src/lib/krb5/krb/princ_comp.c index 57787d7f0..4d0d3120e 100644 --- a/src/lib/krb5/krb/princ_comp.c +++ b/src/lib/krb5/krb/princ_comp.c @@ -31,10 +31,13 @@ krb5_const_principal princ2; { register krb5_data * const *p1, * const *p2; - for (p1 = princ1, p2 = princ2; *p1 && *p2; p1++, p2++) - if (memcmp((*p1)->data, (*p2)->data, min((*p1)->length, - (*p2)->length))) + for (p1 = princ1, p2 = princ2; *p1 && *p2; p1++, p2++) { + if ((*p1)->length != (*p2)->length) return FALSE; + if (memcmp((*p1)->data, (*p2)->data, (*p1)->length)) + + return FALSE; + } if (*p1 || *p2) /* didn't both run out of components at once */ return FALSE;