diff options
author | 2001-06-27 00:58:53 +0000 | |
---|---|---|
committer | 2001-06-27 00:58:53 +0000 | |
commit | f1a075da3e4bb4f84a5bb83783c6b1943dc3da49 (patch) | |
tree | f3b98ca6be26aa2b00a7770f1dceff5312265655 /lib/libc/crypt/crypt.c | |
parent | Keep track of the ACQUIRE sequence number, and pass it to the kernel (diff) | |
download | wireguard-openbsd-f1a075da3e4bb4f84a5bb83783c6b1943dc3da49.tar.xz wireguard-openbsd-f1a075da3e4bb4f84a5bb83783c6b1943dc3da49.zip |
use strlcpy vs strncpy+a[len-1]='\0'. millert@ ok.
Diffstat (limited to 'lib/libc/crypt/crypt.c')
-rw-r--r-- | lib/libc/crypt/crypt.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/crypt/crypt.c b/lib/libc/crypt/crypt.c index 8fd319a4f31..d1a342c1787 100644 --- a/lib/libc/crypt/crypt.c +++ b/lib/libc/crypt/crypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypt.c,v 1.13 1998/03/22 19:01:18 niklas Exp $ */ +/* $OpenBSD: crypt.c,v 1.14 2001/06/27 00:58:53 lebel Exp $ */ /* * FreeSec: libcrypt @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: crypt.c,v 1.13 1998/03/22 19:01:18 niklas Exp $"; +static char rcsid[] = "$OpenBSD: crypt.c,v 1.14 2001/06/27 00:58:53 lebel Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -650,7 +650,7 @@ crypt(key, setting) if (des_setkey((u_char *) keybuf)) return(NULL); } - strncpy((char *)output, setting, 9); + strlcpy((char *)output, setting, 10); /* * Double check that we weren't given a short setting. @@ -659,7 +659,6 @@ crypt(key, setting) * Just make sure the output string doesn't have an extra * NUL in it. */ - output[9] = '\0'; p = output + strlen((const char *)output); } else { /* |