From ca970979e9a2b62646b610bfc32f655993527d03 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 16 Jul 2018 10:32:08 +0200 Subject: [PATCH] netifd: make sure the vlan ifname fits into the buffer Signed-off-by: John Crispin --- vlan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vlan.c b/vlan.c index 221c79c..c3ab2d2 100644 --- a/vlan.c +++ b/vlan.c @@ -106,6 +106,9 @@ static struct device *get_vlan_device(struct device *dev, int id, bool create) struct vlan_device *vldev; struct device_user *dep; + if (strlen(dev->ifname) > (IFNAMSIZ - 6)) + return NULL; + /* look for an existing interface before creating a new one */ list_for_each_entry(dep, &dev->users.list, list.list) { if (dep->cb != vlan_dev_cb) -- 2.25.1