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

rrset: fix NAPTR size computation

parent 287dbc1f
No related branches found
No related tags found
No related merge requests found
......@@ -272,12 +272,12 @@ static int write_rdata_naptr(uint8_t **src, size_t *src_avail,
/* Variable fields size (flags, services, regexp) */
for (int i = 0; i < 3; i++) {
uint8_t *len_ptr = *wire + size;
if (len_ptr >= *wire + *capacity) {
uint8_t *len_ptr = *src + size;
if (len_ptr >= *src + *src_avail) {
return KNOT_EMALF;
}
size += *len_ptr;
size += 1 + *len_ptr;
}
/* Copy result */
......
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