pidgin: 7eb555d9: jabber: Protect against broken OSes and ...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Mon Nov 1 22:45:47 EDT 2010
----------------------------------------------------------------------
Revision: 7eb555d9d20df94a7bef577253c8effb724ab484
Parent: 510f0e4ccad1925fb150ff2c8fa08c7c1fe62549
Author: darkrain42 at pidgin.im
Date: 11/01/10 22:06:13
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7eb555d9d20df94a7bef577253c8effb724ab484
Changelog:
jabber: Protect against broken OSes and printf("%s", NULL) crashes
Changes against parent 510f0e4ccad1925fb150ff2c8fa08c7c1fe62549
patched libpurple/protocols/jabber/adhoccommands.c
patched libpurple/protocols/jabber/presence.c
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/presence.c ed4c461fe70b553d0caeefc07b0b949649f10d7e
+++ libpurple/protocols/jabber/presence.c 58980b952442018ac09ede1e90c64187c0357eac
@@ -995,12 +995,14 @@ void jabber_presence_parse(JabberStream
}
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)
============================================================
--- libpurple/protocols/jabber/adhoccommands.c ab99b44d8822d021a3110688b009fe30c26fd8b1
+++ libpurple/protocols/jabber/adhoccommands.c 8bd27c2dc8d608e56b0855281ccb40fae88a13f5
@@ -125,7 +125,8 @@ static void do_adhoc_action_cb(JabberStr
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)
More information about the Commits
mailing list