aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2025-06-20 15:12:04 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2025-06-20 15:12:04 +0100
commit8ddb4ec56ca02eb37eab99337039b5fe326e7031 (patch)
treee26efa2ae7aee2f201f4e6de2a5587e64bac92fd
parentd3ae2d65dcc959dd404fa27aae7a875df5da14cc (diff)
downloadrspamd-8ddb4ec56ca02eb37eab99337039b5fe326e7031.tar.gz
rspamd-8ddb4ec56ca02eb37eab99337039b5fe326e7031.zip
[Minor] Fix build issues
-rw-r--r--src/libstat/stat_process.c10
-rw-r--r--src/lua/lua_parsers.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 0bb658a3a..176064087 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 Vsevolod Stakhov
+ * Copyright 2025 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -108,12 +108,12 @@ rspamd_stat_tokenize_parts_metadata(struct rspamd_stat_ctx *st_ctx,
"M",
task->tokens);
}
- goto meta_words_done;
+ return;
meta_words_error:
- /* On error, just continue without the problematic tokens */
-meta_words_done:
- /* kvec memory will be freed with task pool */
+
+ msg_err("cannot process meta words for task"
+ "memory allocation error, skipping the remaining");
}
/*
diff --git a/src/lua/lua_parsers.c b/src/lua/lua_parsers.c
index f1208abd2..4756b1180 100644
--- a/src/lua/lua_parsers.c
+++ b/src/lua/lua_parsers.c
@@ -108,8 +108,8 @@ int lua_parsers_tokenize_text(lua_State *L)
struct rspamd_lua_text *t;
struct rspamd_process_exception *ex;
UText utxt = UTEXT_INITIALIZER;
- GArray *res;
- rspamd_stat_token_t *w;
+ rspamd_words_t *res;
+ rspamd_word_t *w;
if (lua_type(L, 1) == LUA_TSTRING) {
in = luaL_checklstring(L, 1, &len);
@@ -175,10 +175,10 @@ int lua_parsers_tokenize_text(lua_State *L)
lua_pushnil(L);
}
else {
- lua_createtable(L, res->len, 0);
+ lua_createtable(L, kv_size(*res), 0);
- for (i = 0; i < res->len; i++) {
- w = &g_array_index(res, rspamd_stat_token_t, i);
+ for (i = 0; i < kv_size(*res); i++) {
+ w = &kv_A(*res, i);
lua_pushlstring(L, w->original.begin, w->original.len);
lua_rawseti(L, -2, i + 1);
}