Skip to content

Commit dd33f5f

Browse files
committed
Check roster push authorization
1 parent 307f16c commit dd33f5f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: xmpp-vala/src/module/roster/module.vala

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public class Module : XmppStreamModule, Iq.Handler {
4747
public void on_iq_set(XmppStream stream, Iq.Stanza iq) {
4848
StanzaNode? query_node = iq.stanza.get_subnode("query", NS_URI);
4949
if (query_node == null) return;
50+
if (!iq.from.equals(stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid)) {
51+
warning("Received alledged roster push from %s, ignoring", iq.from.to_string());
52+
return;
53+
}
5054

5155
Flag flag = stream.get_flag(Flag.IDENTITY);
5256
Item item = new Item.from_stanza_node(query_node.get_subnode("item", NS_URI));

0 commit comments

Comments
 (0)