From 0c0c81ca03f7069caf39e927764ce63de9d4d2d0 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 17 Oct 2006 10:09:11 +0000 Subject: [PATCH] ignore transports with wrong jid. fixes #2574 --- src/common/connection_handlers.py | 7 +++++++ src/common/xmpp_stringprep.py | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 00eb25bd2..9e3eb88d7 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -690,6 +690,13 @@ class ConnectionDisco: attr = {} for key in i.getAttrs(): attr[key] = i.getAttrs()[key] + if 'jid' not in attr: + continue + try: + helpers.parse_jid(attr['jid']) + except: + # jid is not conform + continue items.append(attr) jid = helpers.get_full_jid_from_iq(iq_obj) hostname = gajim.config.get_per('accounts', self.name, diff --git a/src/common/xmpp_stringprep.py b/src/common/xmpp_stringprep.py index f81ed9f2e..f8bad61b4 100644 --- a/src/common/xmpp_stringprep.py +++ b/src/common/xmpp_stringprep.py @@ -185,8 +185,7 @@ class NamePrep: prohibiteds = [unichr(n) for n in range(0x00, 0x2c + 1) + range(0x2e, 0x2f + 1) + range(0x3a, 0x40 + 1) + - range(0x5b, 0x5e + 1) + - range(0x60, 0x60 + 1) + + range(0x5b, 0x60 + 1) + range(0x7b, 0x7f + 1) ] def prepare(self, string):