summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-12-04 21:27:02 +0000
committerderaadt <deraadt@openbsd.org>1999-12-04 21:27:02 +0000
commitdcb896440fa770632b2a23937cfbee436e0c26b0 (patch)
tree99fe84a4b9441f7404fc9dc4e6bd02b83c798cde
parentoflow (diff)
downloadwireguard-openbsd-dcb896440fa770632b2a23937cfbee436e0c26b0.tar.xz
wireguard-openbsd-dcb896440fa770632b2a23937cfbee436e0c26b0.zip
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 525c5cd7181..291a2819ea3 100644
--- a/usr.bin/jot/jot.c
+++ b/usr.bin/jot/jot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: jot.c,v 1.2 1996/06/26 05:34:41 deraadt Exp $ */
+/* $OpenBSD: jot.c,v 1.3 1999/12/04 21:27:02 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.2 1996/06/26 05:34:41 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: jot.c,v 1.3 1999/12/04 21:27:02 deraadt Exp $";
#endif /* not lint */
/*
@@ -138,7 +138,9 @@ getargs(ac, av)
boring = 1;
case 'w':
if ((*av)[2])
- strcpy(format, *av + 2);
+ if (strlcpy(format, *av + 2, sizeof(format)) >=
+ sizeof(format))
+ error("-w word too long", "");
else if (!--ac)
error("Need context word after -w or -b", "");
else
@@ -146,7 +148,9 @@ getargs(ac, av)
break;
case 's':
if ((*av)[2])
- strcpy(sepstring, *av + 2);
+ if (strlcpy(sepstring, *av + 2, sizeof(sepstring)) >=
+ sizeof(sepstring))
+ error("-s word too long", "");
else if (!--ac)
error("Need string after -s", "");
else