From: Vsevolod Stakhov Date: Mon, 6 Oct 2025 08:34:52 +0000 (+0100) Subject: [Minor] Fix parsing of ESMTP arguments for Lua API X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10d4463aa93cf5a5a1db96da94b9ff36f4207fe3;p=thirdparty%2Frspamd.git [Minor] Fix parsing of ESMTP arguments for Lua API --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 946910c258..ffeabc4212 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -4530,8 +4530,9 @@ lua_task_get_rcpt_esmtp_args(lua_State *L) if (endptr == colon) { /* Valid index found */ + const char *old_p = p; p = colon + 1; - len -= (colon - p) + 1; + len -= (p - old_p); /* Store this arg for this recipient */ if (!g_hash_table_contains(rcpt_args_by_idx, GINT_TO_POINTER(rcpt_idx))) { @@ -4639,8 +4640,9 @@ lua_task_get_rcpt_esmtp_args(lua_State *L) if (endptr == colon && rcpt_idx == idx) { found = TRUE; + const char *old_p = p; p = colon + 1; - len -= (colon - p) + 1; + len -= (p - old_p); /* Parse KEY=VALUE */ eq = memchr(p, '=', len);