3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2025-01-03 10:32:33 +01:00

network: handle NULL/hotspot networks when removing secrets

The hotspot case can actually result in network being NULL which
ends up crashing when accessing "->secrets". In addition any
secrets on this network were never removed for hotspot networks
since everything happened in network_unset_hotspot.
This commit is contained in:
James Prestwood 2021-08-18 14:50:25 -07:00 committed by Denis Kenzior
parent 6f9dd97f50
commit ea572f23fc

View File

@ -1823,6 +1823,9 @@ static void network_unset_hotspot(struct network *network, void *user_data)
return;
network_set_info(network, NULL);
l_queue_destroy(network->secrets, eap_secret_info_free);
network->secrets = NULL;
}
static void emit_known_network_removed(struct station *station, void *user_data)
@ -1841,6 +1844,9 @@ static void emit_known_network_removed(struct station *station, void *user_data)
return;
network_set_info(network, NULL);
l_queue_destroy(network->secrets, eap_secret_info_free);
network->secrets = NULL;
}
connected_network = station_get_connected_network(station);
@ -1849,9 +1855,6 @@ static void emit_known_network_removed(struct station *station, void *user_data)
if (network && was_hidden)
station_hide_network(station, network);
l_queue_destroy(network->secrets, eap_secret_info_free);
network->secrets = NULL;
}
static void network_update_hotspot(struct network *network, void *user_data)