Mercurial > hg
changeset 2294:2a9569fd7644
Carbons: Add sender check
Thanks to Georg Lukas for the report.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 26 Jan 2017 22:51:20 +0100 |
parents | 038b864b44c6 |
children | eb96666502f5 |
files | mcabber/mcabber/xmpp.c |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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!");