Skip to content
Snippets Groups Projects
Commit 4816f48a authored by Marek Vavruša's avatar Marek Vavruša Committed by Jan Včelák
Browse files

libknot/rrset: fixed wrong endpos, causing 'pos' to jump backwards

parent ffe071a1
Branches
Tags
No related merge requests found
...@@ -185,6 +185,7 @@ int knot_rrset_rr_to_canonical(knot_rrset_t *rrset) ...@@ -185,6 +185,7 @@ int knot_rrset_rr_to_canonical(knot_rrset_t *rrset)
assert(rdata); assert(rdata);
uint16_t rdlen = knot_rdata_rdlen(rdata); uint16_t rdlen = knot_rdata_rdlen(rdata);
uint8_t *pos = knot_rdata_data(rdata); uint8_t *pos = knot_rdata_data(rdata);
uint8_t *endpos = pos + rdlen;
/* No RDATA */ /* No RDATA */
if (rdlen == 0) { if (rdlen == 0) {
...@@ -205,7 +206,7 @@ int knot_rrset_rr_to_canonical(knot_rrset_t *rrset) ...@@ -205,7 +206,7 @@ int knot_rrset_rr_to_canonical(knot_rrset_t *rrset)
pos += knot_dname_size(pos); pos += knot_dname_size(pos);
break; break;
case KNOT_RDATA_WF_NAPTR_HEADER: case KNOT_RDATA_WF_NAPTR_HEADER:
pos += knot_naptr_header_size(pos, rdata + rdlen); pos += knot_naptr_header_size(pos, endpos);
break; break;
case KNOT_RDATA_WF_REMAINDER: case KNOT_RDATA_WF_REMAINDER:
break; break;
......
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