diff options
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/telnetd/sys_term.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index 88fdd56e004..d253f373d7c 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -1812,6 +1812,11 @@ cleantmp(wtp) return(ret); } +/* + * jobend + * Assumes that if path is not NULL, then user is also + * not NULL. + */ int jobend(jid, path, user) int jid; @@ -1841,10 +1846,10 @@ jobend(jid, path, user) } if (path) { - strncpy(saved_path, path, sizeof(wtmp.ut_tpath)); - strncpy(saved_user, user, sizeof(wtmp.ut_user)); - saved_path[sizeof(saved_path)] = '\0'; - saved_user[sizeof(saved_user)] = '\0'; + strncpy(saved_path, path, sizeof(saved_path) - 1); + strncpy(saved_user, path, sizeof(saved_user) - 1); + saved_path[sizeof(saved_path) - 1] = '\0'; + saved_user[sizeof(saved_user) - 1] = '\0'; } if (saved_jid == 0) { saved_jid = jid; |