From: Vsevolod Stakhov Date: Sat, 2 Sep 2017 12:13:22 +0000 (+0100) Subject: [Minor] Check type of map more strictly X-Git-Tag: 1.7.0~680 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d3f6d9088865aa2605e1c084861a6aa3e44ea154;p=rspamd.git [Minor] Check type of map more strictly --- 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));