ppp: avoid strncpy() in ppp plugin nm_phasechange()

strncpy() is deemed insecure, and it raises at least an eyebrow.
While it's save in this case, just avoid it.

(cherry picked from commit 4d11eba8c5)
(cherry picked from commit 2f6af40cd5)
This commit is contained in:
Thomas Haller 2018-09-11 21:53:04 +02:00
parent 14732eef90
commit 7a8b692226

View file

@ -147,7 +147,7 @@ nm_phasechange (void *data, int arg)
if ( if_indextoname (index, new_name)
&& !nm_streq0 (ifname, new_name)) {
g_message ("nm-ppp-plugin: interface name changed from '%s' to '%s'", ifname, new_name);
strncpy (ifname, new_name, IF_NAMESIZE);
g_strlcpy (ifname, new_name, IF_NAMESIZE);
}
}
}