diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-09-02 13:13:22 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-09-02 13:13:22 +0100 |
commit | d3f6d9088865aa2605e1c084861a6aa3e44ea154 (patch) | |
tree | 77abe749b2be3c98945392473d8bba39a5548cb0 /src/lua | |
parent | a3624d570830f4fcd1f979d38de59434a7c8fa5c (diff) | |
download | rspamd-d3f6d9088865aa2605e1c084861a6aa3e44ea154.tar.gz rspamd-d3f6d9088865aa2605e1c084861a6aa3e44ea154.zip |
[Minor] Check type of map more strictly
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_map.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lua/lua_map.c b/src/lua/lua_map.c index 3e292f4d3..6300216de 100644 --- a/src/lua/lua_map.c +++ b/src/lua/lua_map.c @@ -384,9 +384,12 @@ lua_config_add_map (lua_State *L) g_assert (map_obj != NULL); - if (type == NULL) { + if (type == NULL && cbidx != -1) { type = "callback"; } + else if (type == NULL) { + return luaL_error (L, "invalid map type"); + } if (strcmp (type, "callback") == 0) { map = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (*map)); |