[network-manager-applet] applet-agent: don't assume that KEYRING_SK_TAG is present in attributes (bgo #697566)



commit 981a88d7cc8d2bd39b8ecc027ee52bb6bcfabcc5
Author: Stef Walter <stefw redhat com>
Date:   Wed Apr 10 18:03:22 2013 +0200

    applet-agent: don't assume that KEYRING_SK_TAG is present in attributes (bgo #697566)
    
    Someone may have manually modified the item outside of network-manager
    so its best not to crash here.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697566

 src/applet-agent.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/applet-agent.c b/src/applet-agent.c
index 6b15ec7..731dc7b 100644
--- a/src/applet-agent.c
+++ b/src/applet-agent.c
@@ -364,6 +364,9 @@ keyring_find_secrets_cb (GObject *source,
                if (secret) {
                        attributes = secret_item_get_attributes (item);
                        key_name = g_hash_table_lookup (attributes, KEYRING_SK_TAG);
+                       if (!key_name)
+                               continue;
+
                        g_hash_table_insert (secrets, g_strdup (key_name),
                                             string_to_gvalue (secret_value_get (secret, NULL)));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]