The wrong tls configuration was picked here. It should be of the
primary that is selected by forward->which, not zone->curprimary.
This bug may cause BIND to select the wrong primary when retrieving
the TLS settings, or cause a crash in case the wrongly selected primary
has no TLS settings.
zone->primarytlsnames[forward->which] != NULL)
{
dns_view_t *view = dns_zone_getview(zone);
- dns_name_t *tlsname = zone->primarytlsnames[zone->curprimary];
+ dns_name_t *tlsname = zone->primarytlsnames[forward->which];
result = dns_view_gettransport(view, DNS_TRANSPORT_TLS, tlsname,
&forward->transport);