From 99129ada8841bf39380ad6dbb370a12a818c5beb Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Fri, 15 Jun 2007 10:27:28 +0000 Subject: Turn a (wrong) assertion into a runtime check. Fixes: NB#54826. git-svn-id: https://mission-control.svn.sourceforge.net/svnroot/mission-control/trunk@60 d91c8aed-3f2b-0410-a83d-924a1c20a0ba --- ChangeLog | 5 ++++- libmissioncontrol/mc-account-monitor.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb15ce4b..c443edc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-06-15 Alberto Mardegan + * libmissioncontrol/mc-account-monitor.c: + Turn a (wrong) assertion into a runtime check. Fixes: NB#54826. + * src/mcd-connection.c, src/mcd-master.c: Don't crash if we fail to retrieve account or profile data. Fixes: NB#59649. @@ -11,7 +14,7 @@ * src/mcd-connection.c: Don't let libtelepathy connect the connection by itself; this ensure - we don't lose any status changed signal. + we don't lose any status changed signal. Fixes: NB#54624. * src/mcd-channel.c: Check for the group interface, before using it. diff --git a/libmissioncontrol/mc-account-monitor.c b/libmissioncontrol/mc-account-monitor.c index 9aaf2fc4..9aa69e4e 100644 --- a/libmissioncontrol/mc-account-monitor.c +++ b/libmissioncontrol/mc-account-monitor.c @@ -190,7 +190,7 @@ _account_name_from_key (const gchar *key) const gchar *base, *slash; g_assert (key == strstr (key, MC_ACCOUNTS_GCONF_BASE)); - g_assert (strlen (key) > base_len + 1); + if (strlen (key) <= base_len + 1) return NULL; base = key + base_len + 1; slash = index (base, '/'); @@ -228,6 +228,7 @@ _gconf_notify_cb (GConfClient *client, guint conn_id, GConfEntry *entry, key = key_name (entry->key); key_is_enabledness = strcmp (key, MC_ACCOUNTS_GCONF_KEY_ENABLED) == 0; name = _account_name_from_key (entry->key); + if (!name) return; account = g_hash_table_lookup (priv->accounts, name); /* Was account complete before? */ -- cgit v1.2.3