]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/utmp.c: Replace strncpy(3) call by ZUSTR2STP()
authorAlejandro Colomar <alx@kernel.org>
Tue, 7 Nov 2023 17:03:08 +0000 (18:03 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 26 Nov 2023 12:48:18 +0000 (06:48 -0600)
commit8a1a097afa53238e727dd49236518a4c43d2f5c1
treea2e5be419b08101c4e721ffd1eb1db77a1a8125e
parent751f8e055b43855b861539a556b984fcd18e27a8
lib/utmp.c: Replace strncpy(3) call by ZUSTR2STP()

We were copying from a (zero-padded) fixed-width character array to a
string, but strncpy(3) is meant to do the opposite thing.  ZUSTR2STP()
is designed to be used in this case (like strncat(3)).

Fixes: f40bdfa66a3a ("libmisc: implement `get_session_host()`")
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/utmp.c