aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-09-02 13:13:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-09-02 13:13:22 +0100
commitd3f6d9088865aa2605e1c084861a6aa3e44ea154 (patch)
tree77abe749b2be3c98945392473d8bba39a5548cb0 /src/lua
parenta3624d570830f4fcd1f979d38de59434a7c8fa5c (diff)
downloadrspamd-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.c5
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));