resolve: limit the number NTAs to something sensible

(cherry picked from commit 17e6a3e2a8)
This commit is contained in:
Frantisek Sumsal
2026-05-04 22:07:46 +02:00
committed by Luca Boccassi
parent 4bf52a5d79
commit 75ceeac012
2 changed files with 4 additions and 0 deletions

View File

@@ -683,6 +683,9 @@ int bus_link_method_set_dnssec_negative_trust_anchors(sd_bus_message *message, v
if (r < 0)
return r;
if (strv_length(ntas) > LINK_NEGATIVE_TRUST_ANCHORS_MAX)
return sd_bus_error_set(error, SD_BUS_ERROR_LIMITS_EXCEEDED, "Too many negative trust anchors per link");
STRV_FOREACH(i, ntas) {
r = dns_name_is_valid(*i);
if (r < 0)

View File

@@ -11,6 +11,7 @@
#define LINK_SEARCH_DOMAINS_MAX 1024
#define LINK_DNS_SERVERS_MAX 256
#define LINK_NEGATIVE_TRUST_ANCHORS_MAX 2048
typedef struct LinkAddress {
Link *link;