diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2011-07-22 01:50:22 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2011-07-22 01:50:22 +0400 |
commit | cbecbd93a481a9d832ab36a255f13bd1169e3e06 (patch) | |
tree | 50575676a079ee56ea837e10e168a9c61c10e3dd /src/common/xmpp | |
parent | 24d62c2591fdc55fb24b62e70e9109e95dcf078f (diff) |
fix nameprep for wrong jids. Fixes #6925
Diffstat (limited to 'src/common/xmpp')
-rw-r--r-- | src/common/xmpp/stringprepare.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/xmpp/stringprepare.py b/src/common/xmpp/stringprepare.py index bae16fcec..657895c84 100644 --- a/src/common/xmpp/stringprepare.py +++ b/src/common/xmpp/stringprepare.py @@ -2,7 +2,7 @@ ## src/common/xmpp/stringprepare.py ## ## Copyright (C) 2001-2005 Twisted Matrix Laboratories -## Copyright (C) 2005-2010 Yann Leboulanger <asterix AT lagaule.org> +## Copyright (C) 2005-2011 Yann Leboulanger <asterix AT lagaule.org> ## Copyright (C) 2006 Stefan Bethge <stefan AT lanpartei.de> ## Copyright (C) 2007 Jean-Marie Traissard <jim AT lapin.org> ## @@ -202,6 +202,8 @@ class NamePrep: def nameprep(self, label): label = idna.nameprep(label) self.check_prohibiteds(label) + if len(label) == 0: + raise UnicodeError, "Invalid empty name" if label[0] == '-': raise UnicodeError, "Invalid leading hyphen-minus" if label[-1] == '-': |