From cb274ac18d094a7f862335464b29d8816f26eeef Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 1 Jan 2015 14:19:01 +0100 Subject: [PATCH 1/1] forbid empty domain names --- zone.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zone.py b/zone.py index cc4bd2b..d7c23ff 100644 --- a/zone.py +++ b/zone.py @@ -260,6 +260,8 @@ class Zone: return column_widths((self.abs_hostname(owner), time(self.getTTL(recordType)), recordType, data), (32, 8, 8)) def abs_hostname(self, name): + if name == '': + raise Exception("Empty domain name is not valid") if name == '.' or name == '@': return self._name if name.endswith('.'): -- 2.30.2