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 +## Copyright (C) 2005-2011 Yann Leboulanger ## Copyright (C) 2006 Stefan Bethge ## Copyright (C) 2007 Jean-Marie Traissard ## @@ -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] == '-':