Browse Source

[Feature] Check content for binary stuff before dumping it to Lua

Issue: #4204
tags/3.3
Vsevolod Stakhov 2 years ago
parent
commit
d87f4e9f57
No account linked to committer's email address
2 changed files with 8 additions and 0 deletions
  1. 4
    0
      src/lua/lua_mimepart.c
  2. 4
    0
      src/lua/lua_task.c

+ 4
- 0
src/lua/lua_mimepart.c View File

@@ -1420,6 +1420,10 @@ lua_mimepart_get_content (lua_State * L)
t->len = part->parsed_data.len;
t->flags = 0;

if (lua_is_text_binary(t)) {
t->flags |= RSPAMD_TEXT_FLAG_BINARY;
}

return 1;
}


+ 4
- 0
src/lua/lua_task.c View File

@@ -2662,6 +2662,10 @@ lua_task_get_content (lua_State * L)
t->len = task->msg.len;
t->start = task->msg.begin;
t->flags = 0;

if (lua_is_text_binary(t)) {
t->flags |= RSPAMD_TEXT_FLAG_BINARY;
}
}
else {
return luaL_error (L, "invalid arguments");

Loading…
Cancel
Save