mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 03:48:09 +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) (cherry picked from commit03b63a893f)
This commit is contained in:
parent
42d28ae2e8
commit
09c4fa5a6c
1 changed files with 3 additions and 2 deletions
|
|
@ -634,15 +634,16 @@ connection_removed (NMSettings *settings,
|
||||||
gboolean mapped;
|
gboolean mapped;
|
||||||
KnownNetworkData *data;
|
KnownNetworkData *data;
|
||||||
KnownNetworkId id;
|
KnownNetworkId id;
|
||||||
|
gs_free char *ssid_str = NULL;
|
||||||
|
|
||||||
id.security = nm_wifi_connection_get_iwd_security (conn, &mapped);
|
id.security = nm_wifi_connection_get_iwd_security (conn, &mapped);
|
||||||
if (!mapped)
|
if (!mapped)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
s_wireless = nm_connection_get_setting_wireless (conn);
|
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);
|
data = g_hash_table_lookup (priv->known_networks, &id);
|
||||||
g_free ((char *) id.name);
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue