From c100d489dd3d12409a23b348647f39e56ae6bb42 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 5 Mar 2001 14:10:15 +0000 Subject: Fix ttynames generation broken with strlcat PR: 25541 Submitted by: Nickolay Dudorov --- usr.bin/wall/ttymsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/wall/ttymsg.c b/usr.bin/wall/ttymsg.c index 3dccfbc..c65cfe8 100644 --- a/usr.bin/wall/ttymsg.c +++ b/usr.bin/wall/ttymsg.c @@ -71,7 +71,7 @@ ttymsg(struct iovec *iov, int iovcnt, const char *line, int tmout) if (iovcnt > sizeof(localiov) / sizeof(localiov[0])) return ("too many iov's (change code in wall/ttymsg.c)"); - strlcat(device, line, sizeof(device)); + strlcpy(device + sizeof(_PATH_DEV) - 1, line, sizeof(device)); if (strchr(device + sizeof(_PATH_DEV) - 1, '/')) { /* A slash is an attempt to break security... */ (void) snprintf(errbuf, sizeof(errbuf), -- cgit v1.1