From a7ad3937e5ac46dd20036eb87518c32bad76e953 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Tue, 21 Aug 2001 10:29:01 +0000 Subject: Fix a typo in a variable name that made pw(8) coredump when using USE_MD5RAND. MFC after: 2 days --- pw/pw_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pw/pw_user.c b/pw/pw_user.c index 8a09668..9d00bfa 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -1046,7 +1046,7 @@ pw_getrand(u_char *buf, int len) /* cryptographically secure rng */ MD5Update (&md5_ctx, (u_char*)&tv, sizeof tv); } while (n++<20 || tv.tv_usec-tvo.tv_usec<100*1000); MD5Final (ubuf, &md5_ctx); - memcpy(buf+i, ubuf, MIN(16, len-n)); + memcpy(buf+i, ubuf, MIN(16, len-i)); } return buf; } -- cgit v1.2.3-56-ge451