diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 00:00:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 00:00:39 +0000 |
commit | 1e7741f40999b12a66f37978b280c7fa55b4fa0b (patch) | |
tree | e4567cce7db513c446c3f774631a86b776c957eb /src/smtp/smtp_addr.c | |
parent | Adding upstream version 3.5.24. (diff) | |
download | postfix-1e7741f40999b12a66f37978b280c7fa55b4fa0b.tar.xz postfix-1e7741f40999b12a66f37978b280c7fa55b4fa0b.zip |
Adding upstream version 3.5.25.upstream/3.5.25upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/smtp/smtp_addr.c')
-rw-r--r-- | src/smtp/smtp_addr.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/smtp/smtp_addr.c b/src/smtp/smtp_addr.c index 2210ff7..7509edc 100644 --- a/src/smtp/smtp_addr.c +++ b/src/smtp/smtp_addr.c @@ -230,6 +230,8 @@ static DNS_RR *smtp_addr_one(DNS_RR *addr_list, const char *host, int res_opt, msg_fatal("host %s: conversion error for address family " "%d: %m", host, res0->ai_addr->sa_family); addr_list = dns_rr_append(addr_list, addr); + if (DNS_RR_IS_TRUNCATED(addr_list)) + break; } freeaddrinfo(res0); if (found == 0) { @@ -287,6 +289,8 @@ static DNS_RR *smtp_addr_list(DNS_RR *mx_names, DSN_BUF *why) msg_panic("smtp_addr_list: bad resource type: %d", rr->type); addr_list = smtp_addr_one(addr_list, (char *) rr->data, res_opt, rr->pref, why); + if (addr_list && DNS_RR_IS_TRUNCATED(addr_list)) + break; } return (addr_list); } @@ -382,6 +386,13 @@ static DNS_RR *smtp_balance_inet_proto(DNS_RR *addr_list, int misc_flags, */ /* + * Ensure that dns_rr_append() won't interfere with the protocol + * balancing goals. + */ + if (addr_limit > var_dns_rr_list_limit) + addr_limit = var_dns_rr_list_limit; + + /* * Count the number of IPv6 and IPv4 addresses. */ for (v4_count = v6_count = 0, rr = addr_list; rr != 0; rr = rr->next) { |