mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 09:28:00 +02:00
iwd: Fix a use after free
In connection_removed we use the id.name that was being g_freed a few lines further down. Fixes:bea6c40367('wifi/iwd: handle forgetting connection profiles') (cherry picked from commitc1ff06e119)
This commit is contained in:
parent
d535da216c
commit
03b63a893f
1 changed files with 3 additions and 2 deletions
|
|
@ -673,15 +673,16 @@ connection_removed(NMSettings *settings, NMSettingsConnection *sett_conn, gpoint
|
|||
gboolean mapped;
|
||||
KnownNetworkData * data;
|
||||
KnownNetworkId id;
|
||||
gs_free char * ssid_str = NULL;
|
||||
|
||||
id.security = nm_wifi_connection_get_iwd_security(conn, &mapped);
|
||||
if (!mapped)
|
||||
return;
|
||||
|
||||
s_wireless = nm_connection_get_setting_wireless(conn);
|
||||
id.name = _nm_utils_ssid_to_utf8(nm_setting_wireless_get_ssid(s_wireless));
|
||||
ssid_str = _nm_utils_ssid_to_utf8(nm_setting_wireless_get_ssid(s_wireless));
|
||||
id.name = ssid_str;
|
||||
data = g_hash_table_lookup(priv->known_networks, &id);
|
||||
g_free((char *) id.name);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue