mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-07 17:17:44 +03:00
resolve: drop recursion in TXT field handling
Fixes #25683.
(cherry picked from commit 494ef16743
)
This commit is contained in:
parent
aeb3653744
commit
8ff529fb80
@ -1768,36 +1768,30 @@ int dns_resource_record_get_cname_target(DnsResourceKey *key, DnsResourceRecord
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DnsTxtItem *dns_txt_item_free_all(DnsTxtItem *i) {
|
DnsTxtItem *dns_txt_item_free_all(DnsTxtItem *first) {
|
||||||
DnsTxtItem *n;
|
LIST_FOREACH(items, i, first)
|
||||||
|
free(i);
|
||||||
|
|
||||||
if (!i)
|
return NULL;
|
||||||
return NULL;
|
|
||||||
|
|
||||||
n = i->items_next;
|
|
||||||
|
|
||||||
free(i);
|
|
||||||
return dns_txt_item_free_all(n);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dns_txt_item_equal(DnsTxtItem *a, DnsTxtItem *b) {
|
bool dns_txt_item_equal(DnsTxtItem *a, DnsTxtItem *b) {
|
||||||
|
DnsTxtItem *bb = b;
|
||||||
|
|
||||||
if (a == b)
|
if (a == b)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!a != !b)
|
LIST_FOREACH(items, aa, a) {
|
||||||
return false;
|
if (!bb)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!a)
|
if (memcmp_nn(aa->data, aa->length, bb->data, bb->length) != 0)
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
if (a->length != b->length)
|
bb = bb->items_next;
|
||||||
return false;
|
}
|
||||||
|
|
||||||
if (memcmp(a->data, b->data, a->length) != 0)
|
return !bb;
|
||||||
return false;
|
|
||||||
|
|
||||||
return dns_txt_item_equal(a->items_next, b->items_next);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DnsTxtItem *dns_txt_item_copy(DnsTxtItem *first) {
|
DnsTxtItem *dns_txt_item_copy(DnsTxtItem *first) {
|
||||||
|
Loading…
Reference in New Issue
Block a user