diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-28 15:48:57 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-28 15:48:57 +0100 |
commit | f5299d51ba510e7db5a3fac7861eadcd2316499b (patch) | |
tree | 9e4566ff9d821b4c853d4144277af29560869cda /lualib | |
parent | dd4b3cdeef50038332ccd28c95a9882f17f7777c (diff) | |
download | rspamd-f5299d51ba510e7db5a3fac7861eadcd2316499b.tar.gz rspamd-f5299d51ba510e7db5a3fac7861eadcd2316499b.zip |
[Minor] Add limit for number of files processed in archives
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_magic/heuristics.lua | 2 | ||||
-rw-r--r-- | lualib/lua_scanners/common.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 8aeafae90..c60824bd8 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -267,7 +267,7 @@ local function detect_archive_flaw(part, arch, log_obj) if arch_type == 'zip' then -- Find specific files/folders in zip file - local files = arch:get_files() or {} + local files = arch:get_files(100) or {} for _,file in ipairs(files) do if file == '[Content_Types].xml' then add_msoffice_confidence(10) diff --git a/lualib/lua_scanners/common.lua b/lualib/lua_scanners/common.lua index 5c298b46f..60e5c2cdf 100644 --- a/lualib/lua_scanners/common.lua +++ b/lualib/lua_scanners/common.lua @@ -411,7 +411,7 @@ local function check_parts_match(task, rule) -- check filenames in archives if p:is_archive() then local arch = p:get_archive() - local filelist = arch:get_files_full() + local filelist = arch:get_files_full(1000) for _,f in ipairs(filelist) do ext,ext2 = gen_extension(f.name) if match_filter(task, ext, rule.mime_parts_filter_ext) |