Skip to content
Snippets Groups Projects
Commit 6eb13fda authored by Lubos Slovak's avatar Lubos Slovak
Browse files

EDNS: Fixed wrong parameter check in edns_size().

parent d5b59b9f
No related branches found
No related tags found
No related merge requests found
......@@ -357,9 +357,7 @@ bool knot_edns_has_option(const knot_rrset_t *opt_rr, uint16_t code)
size_t knot_edns_size(knot_rrset_t *opt_rr)
{
if (opt_rr == NULL) {
return KNOT_EINVAL;
}
assert(opt_rr != NULL);
size_t size = KNOT_EDNS_MIN_SIZE;
// Only one RDATA in OPT RRSet
......
......@@ -256,6 +256,10 @@ bool knot_edns_has_option(const knot_rrset_t *opt_rr, uint16_t code);
/*!
* \brief Returns size of the OPT RR in wire format.
*
* \warning This function does not check the parameter, so ensure to check it
* before calling the function. It must not be NULL.
* \note There is an assert() for debug checking of the parameter.
*
* \param opt_rr OPT RR to get the size of.
*
* \return Size of the OPT RR in bytes.
......
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