[OpenWrt-Devel] [PATCH] netifd: make sure the vlan ifnmae fits into the buffer

John Crispin john at phrozen.org
Mon Jul 16 04:33:50 EDT 2018


Signed-off-by: John Crispin <john at phrozen.org>
---
 vlan.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/vlan.c b/vlan.c
index 067f624..43526d8 100644
--- a/vlan.c
+++ b/vlan.c
@@ -104,6 +104,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 -ENAMETOOLONG;
+
 	/* 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.11.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list