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:
Joachim Nilsson
2015-09-15 11:49:47 +02:00
parent 1c04097dca
commit ef05983dc8
+1 -1
View File
@@ -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:
/*