From 10d4463aa93cf5a5a1db96da94b9ff36f4207fe3 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 6 Oct 2025 09:34:52 +0100 Subject: [PATCH] [Minor] Fix parsing of ESMTP arguments for Lua API --- src/lua/lua_task.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.47.3