]> git.ipfire.org Git - thirdparty/util-linux.git/commit
login: use mem2strcpy() rather than rely on printf()
authorKarel Zak <kzak@redhat.com>
Thu, 1 Oct 2020 12:04:21 +0000 (14:04 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 1 Oct 2020 12:04:21 +0000 (14:04 +0200)
commitb648917e0bd3473c5cc26b6d8c5ca93883bfa8b3
tree7439bbb5fd02ae6cc42a47396a2b3f41658e155f
parent3cb827ad36652d0cfe7cc85c5beb29a5fe2998ad
login: use mem2strcpy() rather than rely on printf()

The strings from utmp does not have to be terminated. It's seems
better to explicitly terminate it than rely on "%.*s" printf()
functionality -- printf() man page assumes that "If a precision is
given, no null byte need be present", but static analyzers are pretty
unhappy with it.

Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.c