]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Handle nil opts in DCC plugin initialization
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 7 Dec 2025 16:00:20 +0000 (16:00 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sun, 7 Dec 2025 16:00:20 +0000 (16:00 +0000)
Fixes #5751: The plugin crashed when configured with only 'enabled = false'
because get_all_opt returns nil for empty/disabled config sections.

src/plugins/lua/dcc.lua

index 8cd1c248ba210b9e344e52b31a0e0d898fc611d6..ff01edf9d7faaeb87c4ac8f376e3972500db3fc5 100644 (file)
@@ -42,6 +42,11 @@ if confighelp then
   return
 end
 
+if not opts then
+  lua_util.disable_module(N, "config")
+  return
+end
+
 local rule
 
 local function check_dcc (task)