From: Kurt Zeilenga Date: Mon, 24 May 1999 22:51:13 +0000 (+0000) Subject: Use memcmp not strncmp for non-string comparisons. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e8116a8a74fa6e056863c3c962b4fedcf5d93a00;p=openldap Use memcmp not strncmp for non-string comparisons. --- diff --git a/libraries/liblutil/passwd.c b/libraries/liblutil/passwd.c index beca1aa11c..6dc49b572c 100644 --- a/libraries/liblutil/passwd.c +++ b/libraries/liblutil/passwd.c @@ -98,7 +98,7 @@ lutil_passwd( lutil_SHA1Final(SHA1digest, &SHA1context); /* compare */ - rc = strncmp((char *)orig_pass, (char *)SHA1digest, sizeof(SHA1digest)); + rc = memcmp((char *)orig_pass, (char *)SHA1digest, sizeof(SHA1digest)); free(orig_pass); return(rc); @@ -128,7 +128,7 @@ lutil_passwd( lutil_MD5Final(MD5digest, &MD5context); /* compare */ - rc = strncmp((char *)orig_pass, (char *)MD5digest, sizeof(MD5digest)); + rc = memcmp((char *)orig_pass, (char *)MD5digest, sizeof(MD5digest)); free(orig_pass); return ( rc );