# HG changeset patch # User Paul Aurich # Date 1243395921 0 # Node ID 373141b35c52af9e653a59d8e624582a44a5df5c # Parent 23aa825435038e34ca3ad0e2a2ac2a306790dab4 Avoid an assertion failure and add an error case. diff -r 23aa82543503 -r 373141b35c52 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Wed May 27 03:23:07 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Wed May 27 03:45:21 2009 +0000 @@ -1665,7 +1665,6 @@ 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 @@ while (account->deny != NULL) { purple_privacy_deny_remove(account, account->deny->data, TRUE); } + } else if (item == NULL) { + /* An empty 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");