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.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user