diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-13 02:15:02 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-13 02:15:02 +0000 |
commit | f045cb189e02fb2f4df922a685c49439f2a9296a (patch) | |
tree | 023e625d003ca2c6e7bcf2d2040503c68596dd96 /usr.bin/passwd/local_passwd.c | |
parent | b19f562070955475584cff34e088b6e9e6f3a0d9 (diff) |
excessive paranoia
Diffstat (limited to 'usr.bin/passwd/local_passwd.c')
-rw-r--r-- | usr.bin/passwd/local_passwd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index 51056a1d4f3..4536abf1f8b 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: local_passwd.c,v 1.9 1998/02/24 20:46:14 deraadt Exp $ */ +/* $OpenBSD: local_passwd.c,v 1.10 1998/07/13 02:15:00 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,7 +35,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)local_passwd.c 5.5 (Berkeley) 5/6/91";*/ -static char rcsid[] = "$OpenBSD: local_passwd.c,v 1.9 1998/02/24 20:46:14 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: local_passwd.c,v 1.10 1998/07/13 02:15:00 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -139,7 +139,8 @@ getnewpasswd(pw) (void)printf("Please don't use an all-lower case password.\nUnusual capitalization, control characters or digits are suggested.\n"); continue; } - (void)strcpy(buf, p); + strncpy(buf, p, sizeof buf-1); + buf[sizeof buf-1] = '\0'; if (!strcmp(buf, getpass("Retype new password:"))) break; (void)printf("Mismatch; try again, EOF to quit.\n"); |