summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-12-04 21:28:34 +0000
committerderaadt <deraadt@openbsd.org>1999-12-04 21:28:34 +0000
commitd9cfbd8aaae4356f21769f304187634e792df3ce (patch)
treec0c73234d6e497b87fdc92a092dbd77c3e2a2454
parentoops (diff)
downloadwireguard-openbsd-d9cfbd8aaae4356f21769f304187634e792df3ce.tar.xz
wireguard-openbsd-d9cfbd8aaae4356f21769f304187634e792df3ce.zip
more oflows
-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])