NetworkManager r4279 - in trunk: . system-settings/plugins/keyfile
- From: tambeti svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r4279 - in trunk: . system-settings/plugins/keyfile
- Date: Wed, 12 Nov 2008 13:20:06 +0000 (UTC)
Author: tambeti
Date: Wed Nov 12 13:20:06 2008
New Revision: 4279
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4279&view=rev
Log:
2008-11-12 Tambet Ingo <tambet gmail com>
* system-settings/plugins/keyfile/nm-keyfile-connection.c (copy_one_secret)
(add_secrets): Don't add empty secrets to the secrets hash table.
Modified:
trunk/ChangeLog
trunk/system-settings/plugins/keyfile/nm-keyfile-connection.c
Modified: trunk/system-settings/plugins/keyfile/nm-keyfile-connection.c
==============================================================================
--- trunk/system-settings/plugins/keyfile/nm-keyfile-connection.c (original)
+++ trunk/system-settings/plugins/keyfile/nm-keyfile-connection.c Wed Nov 12 13:20:06 2008
@@ -85,9 +85,12 @@
static void
copy_one_secret (gpointer key, gpointer value, gpointer user_data)
{
- g_hash_table_insert ((GHashTable *) user_data,
- g_strdup ((char *) key),
- string_to_gvalue (value));
+ const char *value_str = (const char *) value;
+
+ if (value_str)
+ g_hash_table_insert ((GHashTable *) user_data,
+ g_strdup ((char *) key),
+ string_to_gvalue (value_str));
}
static void
@@ -103,7 +106,11 @@
return;
if (G_VALUE_HOLDS_STRING (value)) {
- g_hash_table_insert (secrets, g_strdup (key), string_to_gvalue (g_value_get_string (value)));
+ const char *tmp;
+
+ tmp = g_value_get_string (value);
+ if (tmp)
+ g_hash_table_insert (secrets, g_strdup (key), string_to_gvalue (tmp));
} else if (G_VALUE_HOLDS (value, DBUS_TYPE_G_MAP_OF_STRING)) {
/* Flatten the string hash by pulling its keys/values out */
g_hash_table_foreach (g_value_get_boxed (value), copy_one_secret, secrets);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]