From: Vsevolod Stakhov Date: Sat, 23 Apr 2016 11:37:15 +0000 (+0100) Subject: [Fix] Fix creating of URLs from LUA X-Git-Tag: 1.2.6~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99e5dcf7c7354852b5a90dfab31ebb099f1cbad2;p=thirdparty%2Frspamd.git [Fix] Fix creating of URLs from LUA --- diff --git a/src/lua/lua_url.c b/src/lua/lua_url.c index 3e97bbd11e..24c3f9a701 100644 --- a/src/lua/lua_url.c +++ b/src/lua/lua_url.c @@ -487,10 +487,14 @@ lua_url_create (lua_State *L) text = luaL_checklstring (L, 2, &length); if (text != NULL) { - lua_newtable (L); rspamd_url_find_single (pool, text, length, FALSE, lua_url_single_inserter, L); + if (lua_type (L, -1) != LUA_TUSERDATA) { + /* URL is actually not found */ + lua_pushnil (L); + } + } else { lua_pushnil (L);