Commit 0575610f authored by Simon Kelley's avatar Simon Kelley

Handle replies with no answers and no NS in validate_reply.

parent e3f14558
...@@ -1718,6 +1718,10 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch ...@@ -1718,6 +1718,10 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
if (neganswer && !have_answer) if (neganswer && !have_answer)
*neganswer = 1; *neganswer = 1;
/* No data, therefore no sigs */
if (ntohs(header->ancount) + ntohs(header->nscount) == 0)
return STAT_NO_SIG;
for (p1 = ans_start, i = 0; i < ntohs(header->ancount) + ntohs(header->nscount); i++) for (p1 = ans_start, i = 0; i < ntohs(header->ancount) + ntohs(header->nscount); i++)
{ {
......
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