]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/failure.c: Replace strncpy(3) call by STRTCPY()
authorAlejandro Colomar <alx@kernel.org>
Wed, 15 Nov 2023 22:58:23 +0000 (23:58 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sun, 26 Nov 2023 12:48:18 +0000 (06:48 -0600)
commit09957c6d273a7b4c1e85f623ed41633f343be88a
tree317b83e1a5643a08ef64f710709cf5516e4c5333
parent8a1a097afa53238e727dd49236518a4c43d2f5c1
lib/failure.c: Replace strncpy(3) call by STRTCPY()

This call was way too clever.  It relied on the last byte of fail_line
being 0 due to it being in a static structure and never writing to it.
Write an explicit terminating null byte, by using STRTCPY().

Cc: Matthew House <mattlloydhouse@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/failure.c