diff options
author | 1999-12-04 21:27:02 +0000 | |
---|---|---|
committer | 1999-12-04 21:27:02 +0000 | |
commit | dcb896440fa770632b2a23937cfbee436e0c26b0 (patch) | |
tree | 99fe84a4b9441f7404fc9dc4e6bd02b83c798cde | |
parent | oflow (diff) | |
download | wireguard-openbsd-dcb896440fa770632b2a23937cfbee436e0c26b0.tar.xz wireguard-openbsd-dcb896440fa770632b2a23937cfbee436e0c26b0.zip |
oflows
-rw-r--r-- | usr.bin/jot/jot.c | 12 |
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 |