diff options
Diffstat (limited to 'contrib/libucl/lua_ucl.c')
-rw-r--r-- | contrib/libucl/lua_ucl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/libucl/lua_ucl.c b/contrib/libucl/lua_ucl.c index 0d934b771..c2e39c462 100644 --- a/contrib/libucl/lua_ucl.c +++ b/contrib/libucl/lua_ucl.c @@ -885,7 +885,7 @@ lua_ucl_parser_parse_text (lua_State *L) if (lua_type (L, 2) == LUA_TUSERDATA) { t = lua_touserdata (L, 2); } - else { + else if (lua_type (L, 2) == LUA_TSTRING) { const gchar *s; gsize len; static struct _rspamd_lua_text st_t; @@ -896,6 +896,9 @@ lua_ucl_parser_parse_text (lua_State *L) t = &st_t; } + else { + return luaL_error(L, "invalid argument as input, expected userdata or a string"); + } if (lua_type (L, 3) == LUA_TSTRING) { type = lua_ucl_str_to_parse_type (lua_tostring (L, 3)); |