comparison libpurple/protocols/msn/contact.c @ 32782:90ae6701eaf2

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.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 25 May 2012 19:28:41 +0000
parents e10e419e6067
children 2c6510167895
comparison
equal deleted inserted replaced
32781:9686216828f9 32782:90ae6701eaf2
724 annotation; 724 annotation;
725 annotation = xmlnode_get_next_twin(annotation)) { 725 annotation = xmlnode_get_next_twin(annotation)) {
726 char *name, *value; 726 char *name, *value;
727 name = xmlnode_get_data(xmlnode_get_child(annotation, "Name")); 727 name = xmlnode_get_data(xmlnode_get_child(annotation, "Name"));
728 value = xmlnode_get_data(xmlnode_get_child(annotation, "Value")); 728 value = xmlnode_get_data(xmlnode_get_child(annotation, "Value"));
729 if (!strcmp(name, "MSN.IM.MPOP")) { 729 if (name && g_str_equal(name, "MSN.IM.MPOP")) {
730 if (!value || atoi(value) != 0) 730 if (!value || atoi(value) != 0)
731 session->enable_mpop = TRUE; 731 session->enable_mpop = TRUE;
732 else 732 else
733 session->enable_mpop = FALSE; 733 session->enable_mpop = FALSE;
734 } 734 }
801 Name = xmlnode_get_data(displayName); 801 Name = xmlnode_get_data(displayName);
802 else 802 else
803 Name = g_strdup(passport); 803 Name = g_strdup(passport);
804 804
805 for (annotation = xmlnode_get_child(contactInfo, "annotations/Annotation"); 805 for (annotation = xmlnode_get_child(contactInfo, "annotations/Annotation");
806 annotation; annotation = xmlnode_get_next_twin(annotation)) { 806 annotation;
807 annotation = xmlnode_get_next_twin(annotation)) {
807 char *name; 808 char *name;
808 name = xmlnode_get_data(xmlnode_get_child(annotation, "Name")); 809 name = xmlnode_get_data(xmlnode_get_child(annotation, "Name"));
810 if (!name)
811 continue;
809 if (!strcmp(name, "AB.NickName")) 812 if (!strcmp(name, "AB.NickName"))
810 alias = xmlnode_get_data(xmlnode_get_child(annotation, "Value")); 813 alias = xmlnode_get_data(xmlnode_get_child(annotation, "Value"));
811 else if (!strcmp(name, "MSN.IM.HasSharedFolder")) 814 else if (!strcmp(name, "MSN.IM.HasSharedFolder"))
812 ; /* Do nothing yet... */ 815 ; /* Do nothing yet... */
813 else if (!strcmp(name, "AB.Spouse")) 816 else if (!strcmp(name, "AB.Spouse"))