Show More
@@ -535,7 +535,7 class DNSIncoming(object): | |||||
535 |
|
535 | |||
536 | def readString(self, len): |
|
536 | def readString(self, len): | |
537 | """Reads a string of a given length from the packet""" |
|
537 | """Reads a string of a given length from the packet""" | |
538 |
format = '!' |
|
538 | format = '!%ds' % len | |
539 | length = struct.calcsize(format) |
|
539 | length = struct.calcsize(format) | |
540 | info = struct.unpack(format, |
|
540 | info = struct.unpack(format, | |
541 | self.data[self.offset:self.offset + length]) |
|
541 | self.data[self.offset:self.offset + length]) | |
@@ -613,7 +613,7 class DNSIncoming(object): | |||||
613 |
|
613 | |||
614 | def readName(self): |
|
614 | def readName(self): | |
615 | """Reads a domain name from the packet""" |
|
615 | """Reads a domain name from the packet""" | |
616 | result = '' |
|
616 | result = r'' | |
617 | off = self.offset |
|
617 | off = self.offset | |
618 | next = -1 |
|
618 | next = -1 | |
619 | first = off |
|
619 | first = off | |
@@ -625,7 +625,7 class DNSIncoming(object): | |||||
625 | break |
|
625 | break | |
626 | t = len & 0xC0 |
|
626 | t = len & 0xC0 | |
627 | if t == 0x00: |
|
627 | if t == 0x00: | |
628 | result = ''.join((result, self.readUTF(off, len) + '.')) |
|
628 | result = r''.join((result, self.readUTF(off, len) + r'.')) | |
629 | off += len |
|
629 | off += len | |
630 | elif t == 0xC0: |
|
630 | elif t == 0xC0: | |
631 | if next < 0: |
|
631 | if next < 0: |
General Comments 0
You need to be logged in to leave comments.
Login now