# HG changeset patch # User Mikael Berthe # Date 1485467480 -3600 # Node ID 2a9569fd7644ce02baa2dde47ad3823a4cff98a3 # Parent 038b864b44c65ad0db4fe73d7bec32453e7220dc Carbons: Add sender check Thanks to Georg Lukas for the report. diff -r 038b864b44c6 -r 2a9569fd7644 mcabber/mcabber/xmpp.c --- a/mcabber/mcabber/xmpp.c Tue Nov 01 21:42:40 2016 +0100 +++ b/mcabber/mcabber/xmpp.c Thu Jan 26 22:51:20 2017 +0100 @@ -1158,6 +1158,15 @@ // Parse a message that is send to one of our other resources if (!g_strcmp0(carbon_name, "received")) { + // Check envelope JID for carbon messages + gchar *self_bjid = jidtodisp(lm_connection_get_jid(lconnection)); + if (g_strcmp0(self_bjid, bjid)) { + scr_LogPrint(LPRINT_LOGNORM, "Received invalid carbon copy!"); + g_free(self_bjid); + goto handle_messages_return; + } + g_free(self_bjid); + from = lm_message_node_get_attribute(x, "from"); if (!from) { scr_LogPrint(LPRINT_LOGNORM, "Malformed carbon copy!");