Skip to content
Snippets Groups Projects

Add check for \0 bytes in QNAME labels

Merged Daniel Salzman requested to merge nullbyte_lpe into master
Viewing commit bdbfcc9b
Show latest version
1 file
+ 2
1
Preferences
Compare changes
+ 2
1
@@ -319,7 +319,6 @@ int zone_contents_find_dname(const zone_contents_t *zone,
return found;
}
*match = node;
if (previous != NULL) { // Null previous means zone not adjusted yet.
assert(prev);
*previous = prev;
@@ -327,10 +326,12 @@ int zone_contents_find_dname(const zone_contents_t *zone,
if (found == 1 && !null_byte_mismatch(node, name, name_nullbyte)) {
assert(node);
*match = node;
*closest = node;
return ZONE_NAME_FOUND;
} else {
assert(prev);
*match = NULL;
node = prev;
size_t matched_labels = knot_dname_matched_labels(node->owner, name);
while (matched_labels < knot_dname_labels(node->owner, NULL)) {