Commit 640c1041 authored by Alexandre's avatar Alexandre
Browse files

Catch exception on malformed DNS message

parent b0cec718
......@@ -57,7 +57,11 @@ class RequestDOT(Request):
def store_response(self, rcode, data, size):
self.rcode = True
self.response = dns.message.from_wire(data)
try:
self.response = dns.message.from_wire(data)
except dns.exception.FormError as e:
self.response = "ERROR %s" % e
self.rcode = False
self.response_size = size
......@@ -90,6 +94,9 @@ class RequestDOH(Request):
if debug:
self.response += " \"%s\"" % response[:100]
self.success = False
except dns.exception.FormError as e:
self.response = "ERROR %s" % e
self.success = False
else:
self.response = response
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment