Skip to content
Snippets Groups Projects
Commit b4d53418 authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Fix in dnslib_dname_compare().

Was not initializing the position pointers.
parent cfec8063
Branches
Tags
No related merge requests found
......@@ -234,8 +234,6 @@ int dnslib_dname_compare( const dnslib_dname_t *d1, const dnslib_dname_t *d2 )
return 0;
}
const uint8_t *pos1, *pos2;
// jump to the last label and store addresses of labels on the way there
// TODO: consider storing label offsets in the domain name structure
const uint8_t *labels1[DNSLIB_MAX_DNAME_LABELS];
......@@ -243,6 +241,9 @@ int dnslib_dname_compare( const dnslib_dname_t *d1, const dnslib_dname_t *d2 )
int i1 = 0;
int i2 = 0;
const uint8_t *pos1 = dnslib_dname_name(d1);
const uint8_t *pos2 = dnslib_dname_name(d1);
while (*pos1 != '\0') {
labels1[i1++] = pos1;
pos1 += *pos1;
......
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