pidgin: 1f233991: Apparently, some random servers have dec...

qulogic at pidgin.im qulogic at pidgin.im
Sun May 27 00:34:00 EDT 2012


----------------------------------------------------------------------
Revision: 1f233991b11d30d7bd9d1e058e19fe162a9600f3
Parent:   444dec0882a9950944852a408a50904a458629bf
Author:   qulogic at pidgin.im
Date:     05/25/12 15:28:41
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1f233991b11d30d7bd9d1e058e19fe162a9600f3

Changelog: 

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.

Changes against parent 444dec0882a9950944852a408a50904a458629bf

  patched  libpurple/protocols/msn/contact.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/contact.c	8a1024b7df24c804ea66ac6325f2f7816b6aa2e1
+++ libpurple/protocols/msn/contact.c	4d26868ee973e5963618e681d1b62f6ee867c520
@@ -726,7 +726,7 @@ msn_parse_addressbook_contacts(MsnSessio
 				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 @@ msn_parse_addressbook_contacts(MsnSessio
 			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"))


More information about the Commits mailing list