pidgin: 5fbf8465: Avoid an assertion failure and add an er...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Tue May 26 23:50:21 EDT 2009
-----------------------------------------------------------------
Revision: 5fbf84659941fddbd3b62ea7d6db5b70cb8fb4fd
Ancestor: 655ba3e3e891bccc81dda417e005f36fb906c98b
Author: darkrain42 at pidgin.im
Date: 2009-05-27T03:45:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5fbf84659941fddbd3b62ea7d6db5b70cb8fb4fd
Modified files:
libpurple/protocols/jabber/jabber.c
ChangeLog:
Avoid an assertion failure and add an error case.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c 7e0377f42fa59b99b8842f45a9771d0bf2995c98
+++ libpurple/protocols/jabber/jabber.c 3abd27262afe1e4ab66e33c8c21a4709d6e6ac6c
@@ -1665,7 +1665,6 @@ void jabber_blocklist_parse_push(JabberS
xmlnode *error, *x;
result = jabber_iq_new(js, JABBER_IQ_ERROR);
xmlnode_set_attrib(result->node, "id", id);
- xmlnode_set_attrib(result->node, "to", from);
error = xmlnode_new_child(result->node, "error");
xmlnode_set_attrib(error, "type", "cancel");
@@ -1687,6 +1686,19 @@ void jabber_blocklist_parse_push(JabberS
while (account->deny != NULL) {
purple_privacy_deny_remove(account, account->deny->data, TRUE);
}
+ } else if (item == NULL) {
+ /* An empty <block/> is bogus */
+ xmlnode *error, *x;
+ result = jabber_iq_new(js, JABBER_IQ_ERROR);
+ xmlnode_set_attrib(result->node, "id", id);
+
+ error = xmlnode_new_child(result->node, "error");
+ xmlnode_set_attrib(error, "type", "modify");
+ x = xmlnode_new_child(error, "bad-request");
+ xmlnode_set_namespace(x, "urn:ietf:params:xml:ns:xmpp-stanzas");
+
+ jabber_iq_send(result);
+ return;
} else {
for ( ; item; item = xmlnode_get_next_twin(item)) {
const char *jid = xmlnode_get_attrib(item, "jid");
More information about the Commits
mailing list