Jive Software Open Source

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Openfire (ARCHIVED)
  • JM-1237

Nullpointer in LocalOutgoingServerSession

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 3.6.0
  • Component/s: Core
  • Labels:
    None
  • Acceptance Test - Add?:
    No

Description

This is an excerpt from LocalOutgoingServerSession#returnErrorToSender(Packet packet):

if (packet instanceof IQ) {
    IQ reply = new IQ();
    reply.setID(packet.getID());
    reply.setTo(packet.getFrom());
    reply.setFrom(packet.getTo());
    reply.setChildElement(((IQ) packet).getChildElement().createCopy());
    reply.setError(PacketError.Condition.remote_server_not_found);
    routingTable.routePacket(reply.getTo(), reply, true);
}

There's a discussion thread related to this issue here: http://www.igniterealtime.org/community/thread/30048

This code will throw a NullPointerException if the IQ that is being replied to doesn't have a child element (this is valid for IQ types 'result' and 'error'). It is in any case a violation of RFC-3920 to respond with an 'error' stanza to an 'error' or 'result' stanza.

Something like this should fix the problem. It does no longer notify the sender that a problem occurred though:

if (packet instanceof IQ) {
	if (((IQ) packet).isResponse()) {
		Log.warn("XMPP specs forbid us to respond with an IQ error to: " + packet);
		return;
	}
	IQ reply = new IQ();
	reply.setID(packet.getID());
	reply.setTo(packet.getFrom());
	reply.setFrom(packet.getTo());
	reply.setChildElement(iq.getChildElement().createCopy());
	reply.setError(PacketError.Condition.remote_server_not_found);
	routingTable.routePacket(reply.getTo(), reply, true);
}

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Source
  • Reviews
  • Builds
There are no comments yet on this issue.

People

  • Assignee:
    Guus der Kinderen
    Reporter:
    Guus der Kinderen
Vote (0)
Watch (0)

Dates

  • Created:
    01/03/08 11:10 PM
    Updated:
    04/25/08 07:20 PM
    Resolved:
    04/25/08 07:20 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for igniterealtime.org. Try JIRA - bug tracking software for your team.