From: Felix Fietkau Date: Tue, 18 May 2021 04:20:00 +0000 (+0200) Subject: wireless: fix memory corruption bug when using vlans/station entries in the config X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=87e469be0c08db92b0fb0f4817cc177c158cdf42;p=project%2Fnetifd.git wireless: fix memory corruption bug when using vlans/station entries in the config On config reload, any vif entries in the config added to the vlist will be matched against existing ones, and the old entries preserved. This means that the vif pointer is no longer valid after vlist_add. Look up the vif again before using it for vlan/station entries. Signed-off-by: Felix Fietkau --- diff --git a/wireless.c b/wireless.c index 818f7c9..c465a16 100644 --- a/wireless.c +++ b/wireless.c @@ -1129,7 +1129,8 @@ struct wireless_interface* wireless_interface_create(struct wireless_device *wde vif->isolate = false; vlist_add(&wdev->interfaces, &vif->node, vif->name); - return vif; + + return vlist_find(&wdev->interfaces, name, vif, node); } static void