diff options
author | 1997-08-23 00:03:46 +0000 | |
---|---|---|
committer | 1997-08-23 00:03:46 +0000 | |
commit | 7b6d253e879aba369eda929c6ace722fae1d16a0 (patch) | |
tree | b990f26b7f322436184399c53f90a766d0c25dd3 | |
parent | Strip trailing slashes from source (we already did dest). (diff) | |
download | wireguard-openbsd-7b6d253e879aba369eda929c6ace722fae1d16a0.tar.xz wireguard-openbsd-7b6d253e879aba369eda929c6ace722fae1d16a0.zip |
Avoid buf oflow. From Warner Losh <imp@rover.village.org>
-rw-r--r-- | usr.bin/tip/tipout.c | 6 |
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); } |