summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-09-11 21:53:04 +0200
committerThomas Haller <thaller@redhat.com>2018-09-12 09:46:28 +0200
commit2f6af40cd5fdd3cd1cf2ba825b9a1e9beccb9381 (patch)
tree3461a23ddd29009d454e824b8245a620eef8904b
parent7c50748dcc2e51ba5e0588a782af6f25aec26e4e (diff)
downloadNetworkManager-2f6af40cd5fdd3cd1cf2ba825b9a1e9beccb9381.tar.gz
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 4d11eba8c59b6dc00a0cc4b644104b19873699c9)
-rw-r--r--src/ppp/nm-pppd-plugin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ppp/nm-pppd-plugin.c b/src/ppp/nm-pppd-plugin.c
index 989f74339d..0919634006 100644
--- a/src/ppp/nm-pppd-plugin.c
+++ b/src/ppp/nm-pppd-plugin.c
@@ -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);
}
}
}