Browse Source

[Minor] Check type of map more strictly

tags/1.7.0
Vsevolod Stakhov 6 years ago
parent
commit
d3f6d90888
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/lua/lua_map.c

+ 4
- 1
src/lua/lua_map.c View File

@@ -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));

Loading…
Cancel
Save