From e8116a8a74fa6e056863c3c962b4fedcf5d93a00 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 24 May 1999 22:51:13 +0000 Subject: [PATCH] Use memcmp not strncmp for non-string comparisons. --- libraries/liblutil/passwd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ); -- 2.39.5