ifnet: fix a crash in ifnet settings plugin (bgo #737645)

conn_name can be NULL now as the connections are tracked by UUID
(see commit 689dadaffb)

Sep 29 21:20:34 Jdeapad NetworkManager[1339]: <info> getting unmanaged specs...
Sep 29 21:20:34 Jdeapad NetworkManager[1339]: <info> Checking unmanaged: (null)
Sep 29 21:20:38 Jdeapad kernel: NetworkManager[1339]: segfault at 0 ip
00007f1bfffbedd0 sp 00007fff98daa628 error 4 in
libglib-2.0.so.0.4002.0[7f1bfff86000+130000]

https://bugzilla.gnome.org/show_bug.cgi?id=737645
This commit is contained in:
Jiří Klimeš 2014-11-24 14:38:21 +01:00
parent 5cf985e158
commit 91fd36e166
2 changed files with 6 additions and 2 deletions

View file

@ -396,7 +396,11 @@ ifnet_init (gchar * config_file)
const char *
ifnet_get_data (const char *conn_name, const char *key)
{
GHashTable *conn = g_hash_table_lookup (conn_table, conn_name);
GHashTable *conn;
g_return_val_if_fail (conn_name && key, NULL);
conn = g_hash_table_lookup (conn_table, conn_name);
if (conn)
return g_hash_table_lookup (conn, key);

View file

@ -393,7 +393,7 @@ check_unmanaged (gpointer key, gpointer data, gpointer user_data)
conn_name = nm_ifnet_connection_get_conn_name (connection);
if (is_managed (conn_name))
if (!conn_name || is_managed (conn_name))
return;
nm_log_info (LOGD_SETTINGS, "Checking unmanaged: %s", conn_name);