Commit 7865af26 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Added validation of null FROM values in #sendPacket(Component, Packet)

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5862 b35dd754-fafc-0310-a699-88a17e54d16e
parent 612bcf4c
...@@ -155,6 +155,10 @@ public class InternalComponentManager implements ComponentManager, RoutableChann ...@@ -155,6 +155,10 @@ public class InternalComponentManager implements ComponentManager, RoutableChann
} }
public void sendPacket(Component component, Packet packet) { public void sendPacket(Component component, Packet packet) {
if (packet != null && packet.getFrom() == null) {
throw new IllegalArgumentException("Packet with no FROM address was received from component.");
}
PacketRouter router = XMPPServer.getInstance().getPacketRouter(); PacketRouter router = XMPPServer.getInstance().getPacketRouter();
if (router != null) { if (router != null) {
router.route(packet); router.route(packet);
...@@ -199,7 +203,7 @@ public class InternalComponentManager implements ComponentManager, RoutableChann ...@@ -199,7 +203,7 @@ public class InternalComponentManager implements ComponentManager, RoutableChann
} }
public void setProperty(String name, String value) { public void setProperty(String name, String value) {
//To change body of implemented methods use File | Settings | File Templates. //Ignore
} }
public String getServerName() { public String getServerName() {
...@@ -211,7 +215,7 @@ public class InternalComponentManager implements ComponentManager, RoutableChann ...@@ -211,7 +215,7 @@ public class InternalComponentManager implements ComponentManager, RoutableChann
} }
public boolean isExternalMode() { public boolean isExternalMode() {
return false; //To change body of implemented methods use File | Settings | File Templates. return false;
} }
public org.xmpp.component.Log getLog() { public org.xmpp.component.Log getLog() {
......
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