# HG changeset patch # User Elliott Sales de Andrade # Date 1337974121 0 # Node ID 90ae6701eaf2a97118ba4104dd6b74ae0c84b1e2 # Parent 9686216828f97ebd09b2da9eadc640f9a989bc75 Apparently, some random servers have decided to send us an annotation with no name, and the value isn't really self-describing either. Anyway, this empty name could cause a crash. Fixes #15126. diff -r 9686216828f9 -r 90ae6701eaf2 libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Fri May 25 18:02:53 2012 +0000 +++ b/libpurple/protocols/msn/contact.c Fri May 25 19:28:41 2012 +0000 @@ -726,7 +726,7 @@ char *name, *value; name = xmlnode_get_data(xmlnode_get_child(annotation, "Name")); value = xmlnode_get_data(xmlnode_get_child(annotation, "Value")); - if (!strcmp(name, "MSN.IM.MPOP")) { + if (name && g_str_equal(name, "MSN.IM.MPOP")) { if (!value || atoi(value) != 0) session->enable_mpop = TRUE; else @@ -803,9 +803,12 @@ Name = g_strdup(passport); for (annotation = xmlnode_get_child(contactInfo, "annotations/Annotation"); - annotation; annotation = xmlnode_get_next_twin(annotation)) { + annotation; + annotation = xmlnode_get_next_twin(annotation)) { char *name; name = xmlnode_get_data(xmlnode_get_child(annotation, "Name")); + if (!name) + continue; if (!strcmp(name, "AB.NickName")) alias = xmlnode_get_data(xmlnode_get_child(annotation, "Value")); else if (!strcmp(name, "MSN.IM.HasSharedFolder"))