# HG changeset patch # User Paul Aurich # Date 1288663573 0 # Node ID 2d029c5cd305807d992c1d2df9af7244080d645f # Parent 5750f2f2cc0dc143645d223c8106cf0919cc38de jabber: Protect against broken OSes and printf("%s", NULL) crashes diff -r 5750f2f2cc0d -r 2d029c5cd305 libpurple/protocols/jabber/adhoccommands.c --- a/libpurple/protocols/jabber/adhoccommands.c Tue Nov 02 01:57:06 2010 +0000 +++ b/libpurple/protocols/jabber/adhoccommands.c Tue Nov 02 02:06:13 2010 +0000 @@ -125,7 +125,8 @@ xmlnode_set_attrib(command,"node",actionInfo->node); /* cancel is handled differently on ad-hoc commands than regular forms */ - if(!strcmp(xmlnode_get_namespace(result),"jabber:x:data") && !strcmp(xmlnode_get_attrib(result, "type"),"cancel")) { + if (purple_strequal(xmlnode_get_namespace(result), "jabber:x:data") && + purple_strequal(xmlnode_get_attrib(result, "type"), "cancel")) { xmlnode_set_attrib(command,"action","cancel"); } else { if(actionhandle) diff -r 5750f2f2cc0d -r 2d029c5cd305 libpurple/protocols/jabber/presence.c --- a/libpurple/protocols/jabber/presence.c Tue Nov 02 01:57:06 2010 +0000 +++ b/libpurple/protocols/jabber/presence.c Tue Nov 02 02:06:13 2010 +0000 @@ -995,12 +995,14 @@ } for (child = packet->child; child; child = child->next) { + const char *xmlns; char *key; JabberPresenceHandler *pih; if (child->type != XMLNODE_TYPE_TAG) continue; - key = g_strdup_printf("%s %s", child->name, xmlnode_get_namespace(child)); + xmlns = xmlnode_get_namespace(child); + key = g_strdup_printf("%s %s", child->name, xmlns ? xmlns : ""); pih = g_hash_table_lookup(presence_handlers, key); g_free(key); if (pih)