Skip to content
Snippets Groups Projects
Commit 2f415d87 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

packet: limit RR count in packet parsing

parent 16404913
No related branches found
No related tags found
1 merge request!460LibFuzzer support
......@@ -821,6 +821,11 @@ int knot_pkt_parse_payload(knot_pkt_t *pkt, unsigned flags)
size_t rr_count = knot_wire_get_ancount(pkt->wire) +
knot_wire_get_nscount(pkt->wire) +
knot_wire_get_arcount(pkt->wire);
if (rr_count > pkt->size / KNOT_WIRE_RR_MIN_SIZE) {
return KNOT_EMALF;
}
int ret = pkt_rr_array_alloc(pkt, rr_count);
if (ret != KNOT_EOK) {
return ret;
......
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