From: Vsevolod Stakhov Date: Thu, 2 Sep 2021 09:51:59 +0000 (+0100) Subject: [Minor] Explicitly disallow to set settings on top of other settings X-Git-Tag: 3.1~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed6360a904f8082f4048332640e5f09ca9989854;p=thirdparty%2Frspamd.git [Minor] Explicitly disallow to set settings on top of other settings --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index eabbb26090..b095de8e7a 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -5661,6 +5661,13 @@ lua_task_set_settings (lua_State *L) if (settings != NULL && task != NULL) { + if (task->settings) { + /* Do not allow to set settings on top of the existing ones */ + ucl_object_unref (settings); + + return luaL_error (L, "invalid invocation: settings has been already set"); + } + metric_elt = ucl_object_lookup (settings, DEFAULT_METRIC); if (metric_elt) {