summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/crypt/md5crypt.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/libc/crypt/md5crypt.c b/src/lib/libc/crypt/md5crypt.c
index 56ab66fbb5..048858494c 100644
--- a/src/lib/libc/crypt/md5crypt.c
+++ b/src/lib/libc/crypt/md5crypt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: md5crypt.c,v 1.10 2002/02/16 21:27:22 millert Exp $ */ 1/* $OpenBSD: md5crypt.c,v 1.11 2003/04/02 20:35:29 millert Exp $ */
2 2
3/* 3/*
4 * ---------------------------------------------------------------------------- 4 * ----------------------------------------------------------------------------
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#if defined(LIBC_SCCS) && !defined(lint) 15#if defined(LIBC_SCCS) && !defined(lint)
16static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.10 2002/02/16 21:27:22 millert Exp $"; 16static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.11 2003/04/02 20:35:29 millert Exp $";
17#endif /* LIBC_SCCS and not lint */ 17#endif /* LIBC_SCCS and not lint */
18 18
19#include <unistd.h> 19#include <unistd.h>
@@ -108,9 +108,8 @@ md5crypt(pw, salt)
108 MD5Update(&ctx, (const unsigned char *)pw, 1); 108 MD5Update(&ctx, (const unsigned char *)pw, 1);
109 109
110 /* Now make the output string */ 110 /* Now make the output string */
111 strcpy(passwd,(const char *)magic); 111 snprintf(passwd, sizeof(passwd), "%s%.*s$", (char *)magic,
112 strncat(passwd,(const char *)sp,sl); 112 sl, (const char *)sp);
113 strcat(passwd,"$");
114 113
115 MD5Final(final,&ctx); 114 MD5Final(final,&ctx);
116 115