mirror of
https://github.com/OISF/suricata.git
synced 2026-10-12 02:07:10 +00:00
lua/smtp: avoid infinite loop for get_mime_list
Ticket: 8745
This commit is contained in:
committed by
Victor Julien
parent
928ac01215
commit
8e95600253
+4
-5
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user