ircd/authproc.c: avoid crash on lack of any configured DNSBLs

Fixes fbc97166a6
Closes #396
This commit is contained in:
Aaron Jones 2023-01-11 18:39:26 +00:00
parent 7285e5febf
commit e02cc991bb

View file

@ -67,7 +67,7 @@ uint32_t cid;
static rb_dictionary *cid_clients; static rb_dictionary *cid_clients;
static struct ev_entry *timeout_ev; static struct ev_entry *timeout_ev;
rb_dictionary *dnsbl_stats; rb_dictionary *dnsbl_stats = NULL;
rb_dlink_list opm_list; rb_dlink_list opm_list;
struct OPMListener opm_listeners[LISTEN_LAST]; struct OPMListener opm_listeners[LISTEN_LAST];
@ -350,6 +350,8 @@ configure_authd(void)
opm_check_enable(false); opm_check_enable(false);
/* Configure DNSBLs */ /* Configure DNSBLs */
if (dnsbl_stats != NULL)
{
rb_dictionary_iter iter; rb_dictionary_iter iter;
struct DNSBLEntry *entry; struct DNSBLEntry *entry;
RB_DICTIONARY_FOREACH(entry, &iter, dnsbl_stats) RB_DICTIONARY_FOREACH(entry, &iter, dnsbl_stats)
@ -357,6 +359,7 @@ configure_authd(void)
rb_helper_write(authd_helper, "O rbl %s %hhu %s :%s", entry->host, rb_helper_write(authd_helper, "O rbl %s %hhu %s :%s", entry->host,
entry->iptype, entry->filters, entry->reason); entry->iptype, entry->filters, entry->reason);
} }
}
} }
static void static void