Procházet zdrojové kódy

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 <nbd@nbd.name>
Felix Fietkau před 3 roky
rodič
revize
87e469be0c
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      wireless.c

+ 2 - 1
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