Skip to content
Snippets Groups Projects
Commit e8116a8a authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Use memcmp not strncmp for non-string comparisons.

parent 1a7d72e6
No related branches found
No related tags found
No related merge requests found
......@@ -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 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment