Commit b815c266 authored by Florian Schmaus's avatar Florian Schmaus Committed by flow

EntityCapabilitiesManager: Don't handle IQ stanzas with came in through...

EntityCapabilitiesManager: Don't handle IQ stanzas with came in through receivedAnswer() but are not of IQ.Type.result by deeming these packets as invalid (which they are).

It seems that there are some entities that accounce protocol/caps support but do not allow disco#info queries (maybe to avoid information leaks). They send an error IQ instead as rely to disco#info. This causes EntityCapabilitiesManager to throw an NPE:

2013.02.26 13:16:33 org.jivesoftware.openfire.IQRouter - Error proces
sing answer of remote entity. Answer: <iq from="jdev@conference.jabbe
r.org/XXX" to="freakempire.de" type="error" id="204-29"><error c
ode="405" type="cancel"><not-allowed xmlns="urn:ietf:params:xml:ns:xm
pp-stanzas"/></error></iq>
java.lang.NullPointerException
        at org.jivesoftware.openfire.entitycaps.EntityCapabilitiesMan
ager.getIdentitiesFrom(EntityCapabilitiesManager.java:336)
        at org.jivesoftware.openfire.entitycaps.EntityCapabilitiesMan
ager.generateVerHash(EntityCapabilitiesManager.java:237)

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13525 b35dd754-fafc-0310-a699-88a17e54d16e
parent e0c8dac5
......@@ -206,6 +206,9 @@ public class EntityCapabilitiesManager implements IQResultListener, UserEventLis
* hash of the original caps packet.
*/
private boolean isValid(IQ packet) {
if (packet.getType() != IQ.Type.result)
return false;
final EntityCapabilities original = verAttributes.get(packet.getID());
if (original == null) {
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment