Show More
@@ -204,6 +204,13 b' class AbstractMethodException(Exception)' | |||||
204 | class BadTypeInNameException(Exception): |
|
204 | class BadTypeInNameException(Exception): | |
205 | pass |
|
205 | pass | |
206 |
|
206 | |||
|
207 | class BadDomainName(Exception): | |||
|
208 | def __init__(self, pos): | |||
|
209 | Exception.__init__(self, "at position %s" % pos) | |||
|
210 | ||||
|
211 | class BadDomainNameCircular(BadDomainName): | |||
|
212 | pass | |||
|
213 | ||||
207 | # implementation classes |
|
214 | # implementation classes | |
208 |
|
215 | |||
209 | class DNSEntry(object): |
|
216 | class DNSEntry(object): | |
@@ -598,10 +605,10 b' class DNSIncoming(object):' | |||||
598 | next = off + 1 |
|
605 | next = off + 1 | |
599 | off = ((len & 0x3F) << 8) | ord(self.data[off]) |
|
606 | off = ((len & 0x3F) << 8) | ord(self.data[off]) | |
600 | if off >= first: |
|
607 | if off >= first: | |
601 |
raise |
|
608 | raise BadDomainNameCircular(off) | |
602 | first = off |
|
609 | first = off | |
603 | else: |
|
610 | else: | |
604 |
raise |
|
611 | raise BadDomainName(off) | |
605 |
|
612 | |||
606 | if next >= 0: |
|
613 | if next >= 0: | |
607 | self.offset = next |
|
614 | self.offset = next |
General Comments 0
You need to be logged in to leave comments.
Login now