From: Vsevolod Stakhov Date: Fri, 20 Jun 2025 14:12:04 +0000 (+0100) Subject: [Minor] Fix build issues X-Git-Tag: 3.13.0~56^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ddb4ec56ca02eb37eab99337039b5fe326e7031;p=thirdparty%2Frspamd.git [Minor] Fix build issues --- diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index 0bb658a3a7..176064087b 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 f1208abd2a..4756b1180d 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); }