[telepathy-mission-control/master] _mcd_account_delete: don't assume that the account has parameters - failed accounts might not

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Sep 14 09:19:08 PDT 2009


This fixes NULL pointer dereferences in account-manager/bad-cm.py, in
which we create an account whose CM doesn't exist, and delete it.
---
 src/mcd-account.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mcd-account.c b/src/mcd-account.c
index 2c0cbfb..030b6eb 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -1019,7 +1019,7 @@ _mcd_account_delete (McdAccount *account,
 
         params = mcd_manager_get_parameters (priv->manager, priv->protocol_name);
 
-        for (p = params; p->name != NULL; p++)
+        for (p = params; p != NULL && p->name != NULL; p++)
         {
             if (p->flags & TP_CONN_MGR_PARAM_FLAG_SECRET
                 && mc_param_type (p) == G_TYPE_STRING)
-- 
1.5.6.5



More information about the telepathy-commits mailing list