From 8e149bd5035c8d19b89d98feafc085f39c1c1fa4 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sat, 22 Oct 2016 09:42:41 +0200 Subject: [PATCH] Fix potential crash in blacklist module if you have several DNSBLs (#4770). --- src/modules/blacklist.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/blacklist.c b/src/modules/blacklist.c index 9ce3c726a..400dfc57f 100644 --- a/src/modules/blacklist.c +++ b/src/modules/blacklist.c @@ -533,9 +533,17 @@ int blacklist_start_check(aClient *cptr) abort(); /* hmmm. unless we add some /Blacklist CHECK command. then this needs to be removed */ } #endif + for (bl = conf_blacklist; bl; bl = bl->next) + { + /* Stop processing if client is (being) killed already */ + if (!BLUSER(cptr)) + break; + + /* Initiate blacklist requests */ if (bl->backend_type == BLACKLIST_BACKEND_DNS) blacklist_dns_request(cptr, bl); + } /* Free bluser entry. This only happens if you have no blacklist configured or they fail very early */ if (BLUSER(cptr))