From: Vsevolod Stakhov Date: Tue, 21 Jul 2015 13:54:12 +0000 (+0100) Subject: Fix some issues with lua_dns. X-Git-Tag: 1.0.0~315 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c549e66a047b61d71e087617f67932781158f6b;p=thirdparty%2Frspamd.git Fix some issues with lua_dns. --- diff --git a/src/lua/lua_dns.c b/src/lua/lua_dns.c index de7a0c2e89..a471662e28 100644 --- a/src/lua/lua_dns.c +++ b/src/lua/lua_dns.c @@ -277,7 +277,7 @@ lua_dns_resolver_resolve_common (lua_State *L, lua_gettable (L, -2); if (to_resolve == NULL || lua_type (L, -1) != LUA_TFUNCTION) { - lua_pop (L, 1); + lua_pop (L, 2); msg_err ("DNS request has bad params"); lua_pushboolean (L, FALSE); return 1; @@ -315,6 +315,13 @@ lua_dns_resolver_resolve_common (lua_State *L, lua_pop (L, 1); } + lua_pushstring (L, "option"); + lua_gettable (L, -2); + if (lua_type (L, -1) == LUA_TSTRING) { + user_str = luaL_checkstring (L, -1); + } + lua_pop (L, 1); + lua_pop (L, 1); }