Skip to content
Snippets Groups Projects
Commit 9ee03314 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Revert "Check compression pointers for loops."

This reverts commit fdbb1fc2.
parent fdbb1fc2
No related branches found
No related tags found
No related merge requests found
......@@ -499,17 +499,13 @@ knot_dname_t *knot_dname_parse_from_wire(const uint8_t *wire,
dbg_dname("Next label (%d.) position: %zu\n", l, i);
if (knot_wire_is_pointer(wire + p)) {
// pointer.
// printf("Pointer.\n");
p = knot_wire_get_pointer(wire + p);
if (!pointer_used) {
*pos += 2;
pointer_used = 1;
} else {
/* Invalid compression - points to another pointer.
* May result in infinite loop.
*/
return NULL;
}
p = knot_wire_get_pointer(wire + p);
//printf("Pointer: was %zu now %zu, used? %d pos: %zu\n", oldp, p, pointer_used, *pos);
if (p >= size) {
return NULL;
}
......
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