summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-12-11 14:00:48 +0000
committerpeter <peter@FreeBSD.org>1995-12-11 14:00:48 +0000
commit51e26faaf9f91913bbe9077c1cd693ab368baec9 (patch)
treeef9459347d036dac85fc0cfee69d0daa118f5081
parentd20b5a1c02ba491671cfa7ff58c322ea8affb8b8 (diff)
downloadFreeBSD-src-51e26faaf9f91913bbe9077c1cd693ab368baec9.zip
FreeBSD-src-51e26faaf9f91913bbe9077c1cd693ab368baec9.tar.gz
Fix a cosmetic null termination problem for completeness.
The #ifdef NEWSALT code doesn't NULL terminate the salt string.. We dont appear to use this code anymore, but it shouldn't hurt Submitted by: Laurence Lopez <lopez@mv.mv.com>
-rw-r--r--usr.bin/passwd/local_passwd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c
index a8700ea..b98bba3 100644
--- a/usr.bin/passwd/local_passwd.c
+++ b/usr.bin/passwd/local_passwd.c
@@ -82,7 +82,7 @@ getnewpasswd(pw, nis)
{
int tries;
char *p, *t;
- char buf[_PASSWORD_LEN+1], salt[9];
+ char buf[_PASSWORD_LEN+1], salt[10];
struct timeval tv;
if (!nis)
@@ -121,6 +121,7 @@ getnewpasswd(pw, nis)
salt[0] = _PASSWORD_EFMT1;
to64(&salt[1], (long)(29 * 25), 4);
to64(&salt[5], random(), 4);
+ salt[9] = '\0';
#else
/* Make a good size salt for algoritms that can use it. */
to64(&salt[0], random(), 3);
OpenPOWER on IntegriCloud