From 8e95600253013e4275e0c69aca0aa2ed72d3bb99 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Wed, 15 Jul 2026 15:44:00 +0200 Subject: [PATCH] lua/smtp: avoid infinite loop for get_mime_list Ticket: 8745 --- src/util-lua-smtp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/util-lua-smtp.c b/src/util-lua-smtp.c index 9f2cae2040..1fb1f75c80 100644 --- a/src/util-lua-smtp.c +++ b/src/util-lua-smtp.c @@ -109,11 +109,10 @@ static int LuaSmtpTxGetMimeList(lua_State *L) int num = 1; lua_newtable(L); while (SCMimeSmtpGetHeaderName(tx->tx->mime_state, &field_name, &field_len, (uint32_t)num)) { - if (field_len != 0) { - lua_pushinteger(L, num++); - LuaPushStringBuffer(L, field_name, field_len); - lua_settable(L, -3); - } + lua_pushinteger(L, num); + LuaPushStringBuffer(L, field_name, field_len); + lua_settable(L, -3); + num++; } return 1; }