summaryrefslogtreecommitdiff
path: root/usr.bin/tip
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-08-23 00:03:47 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-08-23 00:03:47 +0000
commit9d6198f88f5dc9389499fed487f8ff8decbc8303 (patch)
tree822a031173a24f6d9c74cd5f1a47732d0193f66f /usr.bin/tip
parentb4e386bb75639cab3c33d2c2f20ad6cfa962c581 (diff)
Avoid buf oflow. From Warner Losh <imp@rover.village.org>
Diffstat (limited to 'usr.bin/tip')
-rw-r--r--usr.bin/tip/tipout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tip/tipout.c b/usr.bin/tip/tipout.c
index 40d3268635f..d9591941d74 100644
--- a/usr.bin/tip/tipout.c
+++ b/usr.bin/tip/tipout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tipout.c,v 1.4 1997/04/02 01:47:04 millert Exp $ */
+/* $OpenBSD: tipout.c,v 1.5 1997/08/23 00:03:46 millert Exp $ */
/* $NetBSD: tipout.c,v 1.5 1996/12/29 10:34:12 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)tipout.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: tipout.c,v 1.4 1997/04/02 01:47:04 millert Exp $";
+static char rcsid[] = "$OpenBSD: tipout.c,v 1.5 1997/08/23 00:03:46 millert Exp $";
#endif /* not lint */
#include "tip.h"
@@ -76,7 +76,7 @@ intEMT()
char reply;
read(fildes[0], &c, 1);
- while (c != '\n') {
+ while (c != '\n' && pline - line < sizeof(line)) {
*pline++ = c;
read(fildes[0], &c, 1);
}