summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-12-04 21:28:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-12-04 21:28:35 +0000
commitfb31a6847826ade43a895747a301b603abfa65b3 (patch)
treee8795e4f4ce08ac7a9a7c62d51496d16871dfb51 /usr.bin
parent5fabf9cb69180e67282b4ab47089de44080dd343 (diff)
more oflows
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/jot/jot.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c
index 291a2819ea3..ac9c309d5b4 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: jot.c,v 1.3 1999/12/04 21:27:02 deraadt Exp $ */
+/* $OpenBSD: jot.c,v 1.4 1999/12/04 21:28:34 deraadt Exp $ */
/* $NetBSD: jot.c,v 1.3 1994/12/02 20:29:43 pk Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)jot.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: jot.c,v 1.3 1999/12/04 21:27:02 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: jot.c,v 1.4 1999/12/04 21:28:34 deraadt Exp $";
#endif /* not lint */
/*
@@ -144,7 +144,9 @@ getargs(ac, av)
else if (!--ac)
error("Need context word after -w or -b", "");
else
- strcpy(format, *++av);
+ if (strlcpy(format, *++av, sizeof(format)) >=
+ sizeof(format))
+ error("-w word too long", "");
break;
case 's':
if ((*av)[2])
@@ -154,7 +156,9 @@ getargs(ac, av)
else if (!--ac)
error("Need string after -s", "");
else
- strcpy(sepstring, *++av);
+ if (strlcpy(sepstring, *++av, sizeof(sepstring)) >=
+ sizeof(sepstring))
+ error("-s word too long", "");
break;
case 'p':
if ((*av)[2])