commit 49f38b0d2e3695a0d6d13265aeab02224d6abf60
parent bfd8cead95b18a5e0fb1f13080440ff8a7819548
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Mon, 17 Aug 2020 12:06:38 +0200
station: Don't call network_rank_update with NULL network
Move the update of station->networks_sorted order to before we set
station->connected_network NULL to avoid a crash when we attempt to
use the NULL pointer.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/station.c b/src/station.c
@@ -1298,15 +1298,15 @@ static void station_reset_connection_state(struct station *station)
station_roam_state_clear(station);
- station->connected_bss = NULL;
- station->connected_network = NULL;
-
/* Refresh the ordered network list */
network_rank_update(station->connected_network, false);
l_queue_remove(station->networks_sorted, station->connected_network);
l_queue_insert(station->networks_sorted, station->connected_network,
network_rank_compare, NULL);
+ station->connected_bss = NULL;
+ station->connected_network = NULL;
+
l_dbus_property_changed(dbus, netdev_get_path(station->netdev),
IWD_STATION_INTERFACE, "ConnectedNetwork");
l_dbus_property_changed(dbus, network_get_path(network),