summaryrefslogtreecommitdiffstats
path: root/sbin/dump/optr.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1997-01-07 20:48:24 +0000
committerimp <imp@FreeBSD.org>1997-01-07 20:48:24 +0000
commiteba6461a0360d1811fb9e58dbfe4ab0e3658ccbd (patch)
treee02e65c458a9d952876a5e3db19fabbe45f88b96 /sbin/dump/optr.c
parentc2735e9515ef283947cf5b490018fd18b0b1a35f (diff)
downloadFreeBSD-src-eba6461a0360d1811fb9e58dbfe4ab0e3658ccbd.zip
FreeBSD-src-eba6461a0360d1811fb9e58dbfe4ab0e3658ccbd.tar.gz
Fix many buffer overflows, correct usage of strcat and implement
$TAPE. Inspired by OpenBSD's work in this area. Reviewed by: Peter Wemm, Guido van Rooij and Jordan Hubbard. Obtained from: OpenBSD
Diffstat (limited to 'sbin/dump/optr.c')
-rw-r--r--sbin/dump/optr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index 3c464e4..60a6796 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -244,13 +244,13 @@ static void
sendmes(tty, message)
char *tty, *message;
{
- char t[50], buf[BUFSIZ];
+ char t[MAXPATHLEN], buf[BUFSIZ];
register char *cp;
int lmsg = 1;
FILE *f_tty;
(void) strcpy(t, _PATH_DEV);
- (void) strcat(t, tty);
+ (void) strncat(t, tty, sizeof t - strlen(_PATH_DEV) - 1);
if ((f_tty = fopen(t, "w")) != NULL) {
setbuf(f_tty, buf);
OpenPOWER on IntegriCloud