aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2011-04-18 16:10:36 +0200
committerTobias Brunner <tobias@strongswan.org>2011-04-19 13:48:50 +0200
commitf526b35c455f39aad1fce80894459d9fe3d48e98 (patch)
treedc3714fecbaac25cb1d5f561ea75b96e314ad7b3 /src
parent82017bf417b60a5e72aee78f9c2c5237a1bf9a6f (diff)
downloadstrongswan-f526b35c455f39aad1fce80894459d9fe3d48e98.tar.bz2
strongswan-f526b35c455f39aad1fce80894459d9fe3d48e98.tar.xz
Properly copy interface name if unknown.
We use a static string if the interface name is unknown, so using memcpy with IFNAMSIZ is incorrect as that would overrun the static string.
Diffstat (limited to 'src')
-rw-r--r--src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c b/src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c
index 6d0a56780..8315ed310 100644
--- a/src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c
+++ b/src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c
@@ -350,7 +350,7 @@ static void process_link(private_kernel_netlink_net_t *this,
entry->addrs = linked_list_create();
this->ifaces->insert_last(this->ifaces, entry);
}
- memcpy(entry->ifname, name, IFNAMSIZ);
+ strncpy(entry->ifname, name, IFNAMSIZ);
entry->ifname[IFNAMSIZ-1] = '\0';
if (event)
{