summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-12-04 21:16:05 +0000
committerderaadt <deraadt@openbsd.org>1999-12-04 21:16:05 +0000
commit8c2345295da45cf373e43c54e9111334973c5a74 (patch)
treea27884614bff3c4b438f8980a4c568bf31d0d489
parenta few more overflows gone (diff)
downloadwireguard-openbsd-8c2345295da45cf373e43c54e9111334973c5a74.tar.xz
wireguard-openbsd-8c2345295da45cf373e43c54e9111334973c5a74.zip
oflow
-rw-r--r--usr.bin/skey/skey.c6
-rw-r--r--usr.bin/split/split.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/skey/skey.c b/usr.bin/skey/skey.c
index b9e5aa0eb55..64643b7f17c 100644
--- a/usr.bin/skey/skey.c
+++ b/usr.bin/skey/skey.c
@@ -1,4 +1,4 @@
-/* * $OpenBSD: skey.c,v 1.12 1999/03/06 20:27:41 millert Exp $*/
+/* * $OpenBSD: skey.c,v 1.13 1999/12/04 21:20:20 deraadt Exp $*/
/*
* S/KEY v1.1b (skey.c)
*
@@ -62,7 +62,9 @@ main(argc, argv)
case 'p':
if (i + 1 == argc)
usage(argv[0]);
- (void)strcpy(passwd, argv[++i]);
+ if (strlcpy(passwd, argv[++i], sizeof(passwd)) >
+ sizeof(passwd))
+ errx(1, "Password too long");
pass = 1;
break;
case 'x':
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c
index f7b47eb8b6f..520f500cebe 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: split.c,v 1.4 1999/02/04 03:53:48 millert Exp $ */
+/* $OpenBSD: split.c,v 1.5 1999/12/04 21:16:05 deraadt Exp $ */
/* $NetBSD: split.c,v 1.5 1995/08/31 22:22:05 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)split.c 8.3 (Berkeley) 4/25/94";
#else
-static char rcsid[] = "$OpenBSD: split.c,v 1.4 1999/02/04 03:53:48 millert Exp $";
+static char rcsid[] = "$OpenBSD: split.c,v 1.5 1999/12/04 21:16:05 deraadt Exp $";
#endif
#endif /* not lint */
@@ -145,7 +145,7 @@ main(argc, argv)
++argv;
}
if (*argv != NULL) /* File name prefix. */
- (void)strcpy(fname, *argv++);
+ (void)strlcpy(fname, *argv++, sizeof(fname));
if (*argv != NULL)
usage();