diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-02 20:07:50 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-02 20:07:50 +0000 |
commit | 9573c6e20c7fe3e87e0fea8f328421a5f4ec4909 (patch) | |
tree | 908dd1c99b1a05808a883cc5c1985d3b7298fc30 /usr.bin/wall/ttymsg.c | |
parent | 5f7f909d0d711c7df3d69ed4e7ca26744720340d (diff) |
strlcpy; millert ok
Diffstat (limited to 'usr.bin/wall/ttymsg.c')
-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\"", |