Fix ttynames generation broken with strlcat
PR: 25541 Submitted by: Nickolay Dudorov <nnd@mail.nsk.ru>
This commit is contained in:
parent
83a01c3a80
commit
92992ece46
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=73752
@ -71,7 +71,7 @@ ttymsg(struct iovec *iov, int iovcnt, const char *line, int tmout)
|
|||||||
if (iovcnt > sizeof(localiov) / sizeof(localiov[0]))
|
if (iovcnt > sizeof(localiov) / sizeof(localiov[0]))
|
||||||
return ("too many iov's (change code in wall/ttymsg.c)");
|
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, '/')) {
|
if (strchr(device + sizeof(_PATH_DEV) - 1, '/')) {
|
||||||
/* A slash is an attempt to break security... */
|
/* A slash is an attempt to break security... */
|
||||||
(void) snprintf(errbuf, sizeof(errbuf),
|
(void) snprintf(errbuf, sizeof(errbuf),
|
||||||
|
Loading…
Reference in New Issue
Block a user