]> git.sur5r.net Git - openldap/commitdiff
Use memcmp not strncmp for non-string comparisons.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 24 May 1999 22:51:13 +0000 (22:51 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 24 May 1999 22:51:13 +0000 (22:51 +0000)
libraries/liblutil/passwd.c

index beca1aa11cca6e8760c5e15fdcf5cee042bd3e11..6dc49b572c8378cea614a896dbaecc14bccaaebe 100644 (file)
@@ -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 );