aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/backends/redis_backend.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-05-24 14:13:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-05-24 14:13:13 +0100
commiteb5fc65aca905ad38bab0dae85dba0f9a56d7766 (patch)
tree126bf68a7c23e471920f73951ad8cd2326237a5b /src/libstat/backends/redis_backend.c
parent8303b194152ffc02b5079b6bd08f1fecfd43f5d0 (diff)
downloadrspamd-eb5fc65aca905ad38bab0dae85dba0f9a56d7766.tar.gz
rspamd-eb5fc65aca905ad38bab0dae85dba0f9a56d7766.zip
[Fix] Do not use lightuserdata for traceback
LuaJIT limits lightuserdata usage to 47 bits. On Arm64, this leads to break of the C <-> Lua interoperability using this type. This rework has changed traceback function behaviour from lightuserdata opaque pointer (GString * in particular) to luaL_Buffer. Issue: #2906
Diffstat (limited to 'src/libstat/backends/redis_backend.c')
-rw-r--r--src/libstat/backends/redis_backend.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index d54767c12..5976968a7 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -148,7 +148,6 @@ rspamd_redis_expand_object (const gchar *pattern,
struct rspamd_statfile_config *stcf;
lua_State *L = NULL;
struct rspamd_task **ptask;
- GString *tb;
const gchar *rcpt = NULL;
gint err_idx;
@@ -172,16 +171,15 @@ rspamd_redis_expand_object (const gchar *pattern,
rspamd_lua_setclass (L, "rspamd{task}", -1);
if (lua_pcall (L, 1, 1, err_idx) != 0) {
- tb = lua_touserdata (L, -1);
- msg_err_task ("call to user extraction script failed: %v", tb);
- g_string_free (tb, TRUE);
+ msg_err_task ("call to user extraction script failed: %s",
+ lua_tostring (L, -1));
}
else {
rcpt = rspamd_mempool_strdup (task->task_pool, lua_tostring (L, -1));
}
/* Result + error function */
- lua_pop (L, 2);
+ lua_settop (L, err_idx - 1);
}
if (rcpt) {