Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/nbxmpp
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-10-05 18:38:40 +0300
committerlovetox <philipp@hoerist.com>2020-10-05 18:38:40 +0300
commitf8f99f339d31c1795bb6eef28090609502068df2 (patch)
treed0d854e8c71e9217ba36e62b40497c64781de8eb /nbxmpp
parent9c9cc108865291e2f055f2d270daeae3b933cf3e (diff)
Bookmarks: Catch some invalid room jids
Fixes #111
Diffstat (limited to 'nbxmpp')
-rw-r--r--nbxmpp/modules/bookmarks.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/nbxmpp/modules/bookmarks.py b/nbxmpp/modules/bookmarks.py
index 302ecdf..fa32b28 100644
--- a/nbxmpp/modules/bookmarks.py
+++ b/nbxmpp/modules/bookmarks.py
@@ -140,6 +140,12 @@ class Bookmarks(BaseModule):
error)
continue
+ if jid.localpart is None or jid.resource is not None:
+ self._log.warning('Invalid JID: "%s", %s',
+ conf.getAttr('jid'),
+ error)
+ continue
+
autojoin = self._parse_autojoin(conf.getAttr('autojoin'))
nick = self._parse_nickname(conf.getTagData('nick'))
name = conf.getAttr('name') or None
@@ -170,6 +176,12 @@ class Bookmarks(BaseModule):
error)
return None
+ if jid.localpart is None or jid.resource is not None:
+ self._log.warning('Invalid JID: "%s", %s',
+ item.getAttr('id'),
+ error)
+ return None
+
autojoin = self._parse_autojoin(conference.getAttr('autojoin'))
nick = self._parse_nickname(conference.getTagData('nick'))
name = conference.getAttr('name') or None