summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-05 06:04:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-05 06:04:19 +0000
commit12d710651ac431abff08ec19e3e4fae2dc550419 (patch)
tree4252174b8c311b7274369c8330c932b248f0e1f5
parent15951474c813a504c7d3ed8461288d98379fd4f5 (diff)
col can be locked down with tame "stdio", in case it is fed nasty input,
or if it has bugs. The previous commits by schwarze indicate the latter case was very true until recently... ok doug
-rw-r--r--usr.bin/col/col.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c
index f44d26aa8d1..ff12834bd31 100644
--- a/usr.bin/col/col.c
+++ b/usr.bin/col/col.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: col.c,v 1.17 2015/05/09 20:36:18 schwarze Exp $ */
+/* $OpenBSD: col.c,v 1.18 2015/10/05 06:04:18 deraadt Exp $ */
/* $NetBSD: col.c,v 1.7 1995/09/02 05:48:50 jtc Exp $ */
/*-
@@ -113,6 +113,9 @@ main(int argc, char *argv[])
int adjust, opt, warned;
const char *errstr;
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+
max_bufd_lines = 256;
compress_spaces = 1; /* compress spaces into tabs */
while ((opt = getopt(argc, argv, "bfhl:x")) != -1)