summaryrefslogtreecommitdiffstats
path: root/lib/libcrypt
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-03-07 10:41:11 +0000
committermarkm <markm@FreeBSD.org>2002-03-07 10:41:11 +0000
commit6c270bfa4b0c39cdec60ced4c711cc1c7ea772d4 (patch)
tree591f1815dea7709dd66950949081df7245f563a2 /lib/libcrypt
parent2ee5d124d0f1d892a177f288ee347c8303fe7249 (diff)
downloadFreeBSD-src-6c270bfa4b0c39cdec60ced4c711cc1c7ea772d4.zip
FreeBSD-src-6c270bfa4b0c39cdec60ced4c711cc1c7ea772d4.tar.gz
Darn. There is (now was) a signed/unsigned issue that resulted in a
very long loop. Reported by: nnd@mail.nsk.ru (Nickolay Dudorov)
Diffstat (limited to 'lib/libcrypt')
-rw-r--r--lib/libcrypt/crypt-md5.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcrypt/crypt-md5.c b/lib/libcrypt/crypt-md5.c
index e6fbe72..584563a 100644
--- a/lib/libcrypt/crypt-md5.c
+++ b/lib/libcrypt/crypt-md5.c
@@ -26,8 +26,8 @@ crypt_md5(const char *pw, const char *salt)
{
MD5_CTX ctx,ctx1;
unsigned long l;
- int sl;
- u_int pl, i;
+ int sl, pl;
+ u_int i;
u_char final[MD5_SIZE];
static const char *sp, *ep;
static char passwd[120], *p;
@@ -69,9 +69,9 @@ crypt_md5(const char *pw, const char *salt)
MD5Update(&ctx1, (const u_char *)sp, (u_int)sl);
MD5Update(&ctx1, (const u_char *)pw, strlen(pw));
MD5Final(final, &ctx1);
- for(pl = strlen(pw); pl > 0; pl -= MD5_SIZE)
+ for(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)
MD5Update(&ctx, (const u_char *)final,
- pl > MD5_SIZE ? MD5_SIZE : pl);
+ (u_int)(pl > MD5_SIZE ? MD5_SIZE : pl));
/* Don't leave anything around in vm they could use. */
memset(final, 0, sizeof(final));
OpenPOWER on IntegriCloud