mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
The hostname passed to ulog_login(3) may be optional.
Don't trip on a null pointer being passed to this function when performing a local login. Noticed by: dougb
This commit is contained in:
parent
6f2d322192
commit
c4cd42053e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200421
|
@ -48,7 +48,8 @@ ulog_login(const char *line, const char *user, const char *host)
|
||||||
utx.ut_type = USER_PROCESS;
|
utx.ut_type = USER_PROCESS;
|
||||||
strncpy(utx.ut_line, line, sizeof utx.ut_line);
|
strncpy(utx.ut_line, line, sizeof utx.ut_line);
|
||||||
strncpy(utx.ut_user, user, sizeof utx.ut_user);
|
strncpy(utx.ut_user, user, sizeof utx.ut_user);
|
||||||
strncpy(utx.ut_host, host, sizeof utx.ut_host);
|
if (host != NULL)
|
||||||
|
strncpy(utx.ut_host, host, sizeof utx.ut_host);
|
||||||
gettimeofday(&utx.ut_tv, NULL);
|
gettimeofday(&utx.ut_tv, NULL);
|
||||||
|
|
||||||
ulog_pututxline(&utx);
|
ulog_pututxline(&utx);
|
||||||
|
|
Loading…
Reference in a new issue