mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
Fix Coverity CID #149216: Buffer not NUL terminated
We should of course always use `strlcpy()` instead of `strncpy()`. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -112,7 +112,7 @@ static void nl_link(struct nlmsghdr *nlmsg)
|
||||
if (a->rta_type == IFLA_IFNAME) {
|
||||
char msg[MAX_ARG_LEN];
|
||||
|
||||
strncpy(ifname, RTA_DATA(a), sizeof(ifname));
|
||||
strlcpy(ifname, RTA_DATA(a), sizeof(ifname));
|
||||
switch (nlmsg->nlmsg_type) {
|
||||
case RTM_NEWLINK:
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user