aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_url.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-09 16:22:12 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-09 16:22:32 +0100
commit5f40cc6a64897da15bccefb746aea490ab55820c (patch)
tree6fbcf58fd7c0210ed5f3eea1f49afbbc74236f8e /src/lua/lua_url.c
parent6e16b0a8007bac6af3bb692c7c85fc793c2fbb71 (diff)
downloadrspamd-5f40cc6a64897da15bccefb746aea490ab55820c.tar.gz
rspamd-5f40cc6a64897da15bccefb746aea490ab55820c.zip
[Fix] Add another safe-guard in urls processing
Diffstat (limited to 'src/lua/lua_url.c')
-rw-r--r--src/lua/lua_url.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lua/lua_url.c b/src/lua/lua_url.c
index 8742a6027..d21ab727f 100644
--- a/src/lua/lua_url.c
+++ b/src/lua/lua_url.c
@@ -110,7 +110,7 @@ lua_check_url (lua_State * L, gint pos)
return ud ? ((struct rspamd_lua_url *)ud) : NULL;
}
-static void
+static gboolean
lua_url_single_inserter (struct rspamd_url *url, gsize start_offset,
gsize end_offset, gpointer ud)
{
@@ -120,6 +120,8 @@ lua_url_single_inserter (struct rspamd_url *url, gsize start_offset,
lua_url = lua_newuserdata (L, sizeof (struct rspamd_lua_url));
rspamd_lua_setclass (L, "rspamd{url}", -1);
lua_url->url = url;
+
+ return TRUE;
}
/***
@@ -770,7 +772,7 @@ lua_url_init (lua_State *L)
return 0;
}
-static void
+static gboolean
lua_url_table_inserter (struct rspamd_url *url, gsize start_offset,
gsize end_offset, gpointer ud)
{
@@ -785,6 +787,8 @@ lua_url_table_inserter (struct rspamd_url *url, gsize start_offset,
lua_pushinteger (L, n + 1);
lua_pushlstring (L, url->string, url->urllen);
lua_settable (L, -3);
+
+ return TRUE;
}