mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
If an ut_host field in an utmp entry contains a ':' (e.g. for an xterm session)
w doesn't handle the non-'\0' terminated char arrays in struct utmp properly. Submitted by: jarle@idt.unit.no
This commit is contained in:
parent
d5531570b4
commit
92172c87b4
1 changed files with 2 additions and 1 deletions
|
|
@ -307,7 +307,8 @@ main(argc, argv)
|
|||
p = hp->h_name;
|
||||
}
|
||||
if (x) {
|
||||
(void)snprintf(buf, sizeof(buf), "%s:%s", p, x);
|
||||
(void)snprintf(buf, sizeof(buf), "%s:%.*s", p,
|
||||
ep->utmp.ut_host + UT_HOSTSIZE - x, x);
|
||||
p = buf;
|
||||
}
|
||||
(void)printf("%-*.*s %-2.2s %-*.*s ",
|
||||
|
|
|
|||
Loading…
Reference in a new issue