Commit bcf67b72 authored by Dominik Taborsky's avatar Dominik Taborsky
Browse files

rrset_wire: make trailing data check earlier.

parent 510b4d03
......@@ -265,6 +265,11 @@ static int rdata_len(const uint8_t **src, size_t *src_avail,
_len += ret;
}
if (_src_avail > 0) {
/* Trailing data in message. */
return KNOT_EMALF;
}
return _len;
}
......@@ -672,12 +677,6 @@ static int parse_rdata(const uint8_t *pkt_wire, size_t *pos, size_t pkt_size,
return ret;
}
if (src_avail > 0) {
/* Trailing data in message. */
knot_rdataset_unreserve(rrs, mm);
return KNOT_EMALF;
}
ret = knot_rdataset_sort_at(rrs, rrs->rr_count - 1, mm);
if (ret != KNOT_EOK) {
knot_rdataset_unreserve(rrs, mm);
......
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