(dhcpd/unbound) don't try to handle empty section, closes https://github.com/opnsense/core/issues/1320

This commit is contained in:
Ad Schellevis 2016-12-31 16:25:50 +01:00
parent 54e63dc41f
commit 151e633d09

View File

@ -96,7 +96,7 @@ class DHCPDLease(object):
if line:
if len(line) > 5 and line[0:5] == 'lease':
self._section_data.append(line)
elif len(line) > 1 and line[0] == '}':
elif len(line) > 1 and line[0] == '}' and len(self._section_data) > 0:
self._section_data.append(line)
yield self.parse_lease(self._section_data)
self._section_data = []