prevent message spoofing. Thanks Misc. Fixes #3281

This commit is contained in:
Yann Leboulanger 2007-07-04 13:29:06 +00:00
parent 8abd062365
commit dc2dd87a31
1 changed files with 2 additions and 1 deletions

View File

@ -1433,7 +1433,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
frm = helpers.get_full_jid_from_iq(msg) frm = helpers.get_full_jid_from_iq(msg)
jid = helpers.get_jid_from_iq(msg) jid = helpers.get_jid_from_iq(msg)
addressTag = msg.getTag('addresses', namespace = common.xmpp.NS_ADDRESS) addressTag = msg.getTag('addresses', namespace = common.xmpp.NS_ADDRESS)
if addressTag: # Be sure it comes from one of our resource, else ignore address element
if addressTag and jid == gajim.get_jid_from_account(self.name):
address = addressTag.getTag('address', attrs={'type': 'ofrom'}) address = addressTag.getTag('address', attrs={'type': 'ofrom'})
if address: if address:
frm = address.getAttr('jid') frm = address.getAttr('jid')