# HG changeset patch # User Elliott Sales de Andrade # Date 1249536323 0 # Node ID 975fc5f6443804625eb67ccdfac23ab15462b714 # Parent f9cf1e14838b6df72ddfa4c396cd8a1511398379 Ignore buddies with invalid emails in the membership list or address book, which, to be honest, were probably caused by older versions of Pidgin that were not checking and sending the invalid buddies anyway. Fixes #9505. diff -r f9cf1e14838b -r 975fc5f64438 libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Thu Aug 06 04:59:12 2009 +0000 +++ b/libpurple/protocols/msn/contact.c Thu Aug 06 05:25:23 2009 +0000 @@ -351,14 +351,24 @@ msn_parse_each_member(MsnSession *session, xmlnode *member, const char *node, MsnListId list) { - char *passport = xmlnode_get_data(xmlnode_get_child(member, node)); - char *type = xmlnode_get_data(xmlnode_get_child(member, "Type")); - char *member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId")); - MsnUser *user = msn_userlist_find_add_user(session->userlist, passport, NULL); + char *passport; + char *type; + char *member_id; + MsnUser *user; xmlnode *annotation; guint nid = MSN_NETWORK_UNKNOWN; char *invite = NULL; + passport = xmlnode_get_data(xmlnode_get_child(member, node)); + if (!purple_email_is_valid(passport)) { + g_free(passport); + return; + } + + type = xmlnode_get_data(xmlnode_get_child(member, "Type")); + member_id = xmlnode_get_data(xmlnode_get_child(member, "MembershipId")); + user = msn_userlist_find_add_user(session->userlist, passport, NULL); + for (annotation = xmlnode_get_child(member, "Annotations/Annotation"); annotation; annotation = xmlnode_get_next_twin(annotation)) { @@ -746,6 +756,9 @@ if (passport == NULL) continue; + if (!purple_email_is_valid(passport)) + continue; + if ((displayName = xmlnode_get_child(contactInfo, "displayName"))) Name = xmlnode_get_data(displayName); else