From b4a72d1ad794aef4c623fd530fc38ceb9b95456d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Tue, 14 Jun 2011 19:39:23 +0200 Subject: [PATCH] libnm-glib: fix crash for AddAndActivateConnection() D-Bus call (bgo #652512) When a partial connection is passed to nm_client_add_and_activate_connection(), but it doesn't contain any settings, nm_connection_to_hash() returns NULL and there's a crash later on the NULL hash. --- libnm-glib/nm-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 644af3e4ff..752510aea3 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -763,7 +763,7 @@ nm_client_add_and_activate_connection (NMClient *client, if (partial) hash = nm_connection_to_hash (partial, NM_SETTING_HASH_FLAG_ALL); - else + if (!hash) hash = g_hash_table_new (g_str_hash, g_str_equal); priv = NM_CLIENT_GET_PRIVATE (client);