Exception handled for unknown origins

This commit is contained in:
Alexandre Dulaunoy 2014-08-20 10:51:55 +02:00
parent 94482dcfbf
commit d116cfc37b

View file

@ -146,12 +146,18 @@ class Extract:
for dom in self.validdomain:
if dom[1] == 'A':
ip = dom[2]
try:
orig = self.__origin(ipaddr=dom[2])[1]
except:
continue
if(orig == cc): self.localdom.append(dom)
elif dom[1] == 'CNAME':
cname = str(dom[2])
ip = socket.gethostbyname(cname)
try:
orig = self.__origin(ipaddr=ip)[1]
except:
continue
if(orig == cc): self.localdom.append(dom)
return self.localdom