aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-08-29 17:32:36 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-08-29 17:32:39 +0800
commit6dfd7204baa89c6eb3903753f45b7d416a93b112 (patch)
tree76851e382e9d18dc90b3a40afd9d1d7fff8aa87b /libempathy
parent46369eff9ef4bded8b8215c5900b10cc2fb0069a (diff)
downloadgsoc2013-empathy-6dfd7204baa89c6eb3903753f45b7d416a93b112.tar
gsoc2013-empathy-6dfd7204baa89c6eb3903753f45b7d416a93b112.tar.gz
gsoc2013-empathy-6dfd7204baa89c6eb3903753f45b7d416a93b112.tar.bz2
gsoc2013-empathy-6dfd7204baa89c6eb3903753f45b7d416a93b112.tar.lz
gsoc2013-empathy-6dfd7204baa89c6eb3903753f45b7d416a93b112.tar.xz
gsoc2013-empathy-6dfd7204baa89c6eb3903753f45b7d416a93b112.tar.zst
gsoc2013-empathy-6dfd7204baa89c6eb3903753f45b7d416a93b112.zip
chatroom_manager_parse_chatroom: check account path is valid
https://bugzilla.gnome.org/show_bug.cgi?id=657362
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-chatroom-manager.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c
index bf9ecf11f..043f8a829 100644
--- a/libempathy/empathy-chatroom-manager.c
+++ b/libempathy/empathy-chatroom-manager.c
@@ -210,7 +210,7 @@ static void
chatroom_manager_parse_chatroom (EmpathyChatroomManager *manager,
xmlNodePtr node)
{
- EmpathyChatroom *chatroom;
+ EmpathyChatroom *chatroom = NULL;
TpAccount *account;
xmlNodePtr child;
gchar *str;
@@ -269,6 +269,11 @@ chatroom_manager_parse_chatroom (EmpathyChatroomManager *manager,
xmlFree (str);
}
+ /* account has to be a valid Account object path */
+ if (!tp_dbus_check_valid_object_path (account_id, NULL) ||
+ !g_str_has_prefix (account_id, TP_ACCOUNT_OBJECT_PATH_BASE))
+ goto out;
+
factory = empathy_client_factory_dup ();
account = tp_simple_client_factory_ensure_account (
@@ -292,10 +297,11 @@ chatroom_manager_parse_chatroom (EmpathyChatroomManager *manager,
add_chatroom (manager, chatroom);
g_signal_emit (manager, signals[CHATROOM_ADDED], 0, chatroom);
+out:
g_free (name);
g_free (room);
g_free (account_id);
- g_object_unref (chatroom);
+ tp_clear_object (&chatroom);
}
static gboolean