Skip to content
Snippets Groups Projects
Commit 0e81b6f4 authored by Grigorii Demidov's avatar Grigorii Demidov
Browse files

lib/dnssec: wrong prepend_asterisk() usage was fixed, cleanup

parent 7e5d0204
No related branches found
No related tags found
No related merge requests found
......@@ -353,7 +353,7 @@ fail:
*
* @param tgt Target buffer to write domain name into.
* @param name Name to be added to the asterisk.
* @return 0 or error code
* @return Size of the resulting name or error code.
*/
static int prepend_asterisk(uint8_t *tgt, size_t maxlen, const knot_dname_t *name)
{
......@@ -639,9 +639,10 @@ static int matches_closest_encloser_wildcard(const knot_pkt_t *pkt, knot_section
uint8_t wildcard[KNOT_DNAME_MAXLEN];
int ret = prepend_asterisk(wildcard, sizeof(wildcard), encloser);
if (ret < 3) {
if (ret < 0) {
return ret;
}
assert(ret >= 3);
int flags;
for (unsigned i = 0; i < sec->count; ++i) {
......
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