diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-06-30 16:00:30 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-06-30 16:00:30 +0000 |
commit | b643bb9badf4a995d989b8daf3e33ba8ee6ffda2 (patch) | |
tree | 87720e8aa60a5b4230d0072dfd2b3d422d7dd1cd /usr.bin/tcopy/tcopy.c | |
parent | 46239127052c30fac93140fbe021cdd151fdac8a (diff) |
warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant). These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).
Diffstat (limited to 'usr.bin/tcopy/tcopy.c')
-rw-r--r-- | usr.bin/tcopy/tcopy.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tcopy/tcopy.c b/usr.bin/tcopy/tcopy.c index bd0575cd036..7964d9678fb 100644 --- a/usr.bin/tcopy/tcopy.c +++ b/usr.bin/tcopy/tcopy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcopy.c,v 1.4 1997/04/16 03:43:56 millert Exp $ */ +/* $OpenBSD: tcopy.c,v 1.5 2000/06/30 16:00:22 millert Exp $ */ /* $NetBSD: tcopy.c,v 1.5 1997/04/15 07:23:08 lukem Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)tcopy.c 8.3 (Berkeley) 1/23/95"; #endif -static char rcsid[] = "$OpenBSD: tcopy.c,v 1.4 1997/04/16 03:43:56 millert Exp $"; +static char rcsid[] = "$OpenBSD: tcopy.c,v 1.5 2000/06/30 16:00:22 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -131,7 +131,7 @@ main(argc, argv) inf = argv[0]; if ((outp = open(argv[1], op == VERIFY ? O_RDONLY : op == COPY ? O_WRONLY : O_RDWR, DEFFILEMODE)) < 0) { - err(3, argv[1]); + err(3, "%s", argv[1]); } break; default: @@ -139,7 +139,7 @@ main(argc, argv) } if ((inp = open(inf, O_RDONLY, 0)) < 0) - err(1, inf); + err(1, "%s", inf); buff = getspace(maxblk); |