Skip to content
Snippets Groups Projects
Commit 26660106 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

pkt: reset question count in response if malformed query

parent 56f5fce7
No related branches found
No related tags found
No related merge requests found
......@@ -320,9 +320,14 @@ int knot_pkt_init_response(knot_pkt_t *pkt, const knot_pkt_t *query)
}
pkt->size = base_size;
pkt->qname_size = query->qname_size;
memcpy(pkt->wire, query->wire, base_size);
pkt->qname_size = query->qname_size;
if (query->qname_size == 0) {
/* Reset question count if malformed. */
knot_wire_set_qdcount(pkt->wire, 0);
}
/* Update size and flags. */
knot_wire_set_qr(pkt->wire);
knot_wire_clear_tc(pkt->wire);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment