diff options
author | 2003-04-02 20:07:49 +0000 | |
---|---|---|
committer | 2003-04-02 20:07:49 +0000 | |
commit | 91f8108a5f86ad35f23224c2ba302126fad1d535 (patch) | |
tree | c7d1618f7f43e34c983259068ca430ac86cbb7c6 | |
parent | strlcpy; millert ok (diff) | |
download | wireguard-openbsd-91f8108a5f86ad35f23224c2ba302126fad1d535.tar.xz wireguard-openbsd-91f8108a5f86ad35f23224c2ba302126fad1d535.zip |
strlcpy; millert ok
-rw-r--r-- | usr.bin/wall/ttymsg.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/wall/ttymsg.c b/usr.bin/wall/ttymsg.c index 1fb6194eee4..64c76412cf0 100644 --- a/usr.bin/wall/ttymsg.c +++ b/usr.bin/wall/ttymsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttymsg.c,v 1.10 2002/05/26 09:27:11 deraadt Exp $ */ +/* $OpenBSD: ttymsg.c,v 1.11 2003/04/02 20:07:49 deraadt Exp $ */ /* $NetBSD: ttymsg.c,v 1.3 1994/11/17 07:17:55 jtc Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static const char sccsid[] = "@(#)ttymsg.c 8.2 (Berkeley) 11/16/93"; #endif -static const char rcsid[] = "$OpenBSD: ttymsg.c,v 1.10 2002/05/26 09:27:11 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: ttymsg.c,v 1.11 2003/04/02 20:07:49 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -82,11 +82,12 @@ ttymsg(iov, iovcnt, line, tmout) /* * Ignore lines that start with "ftp" or "uucp". */ - if ((strncmp(line, "ftp", 3) == 0) - || (strncmp(line, "uucp", 4) == 0)) + if ((strncmp(line, "ftp", 3) == 0) || + (strncmp(line, "uucp", 4) == 0)) return (NULL); - (void) strcpy(device + sizeof(_PATH_DEV) - 1, line); + (void) strlcpy(device + sizeof(_PATH_DEV) - 1, line, + sizeof(device) - (sizeof(_PATH_DEV) - 1)); if (strchr(device + sizeof(_PATH_DEV) - 1, '/')) { /* A slash is an attempt to break security... */ (void) snprintf(errbuf, sizeof(errbuf), "'/' in \"%s\"", |