diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-06-11 16:56:58 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-06-11 16:56:58 +0100 |
commit | eba15e9dce30c971aefb5b2f6cbf8d5690d6e427 (patch) | |
tree | 266b6274305e04091bde9d8612a921e0b56ef2ac /src/plugins | |
parent | 4d1cd2128212c4db4aa8b654cb6baa2b4de3378d (diff) | |
download | rspamd-eba15e9dce30c971aefb5b2f6cbf8d5690d6e427.tar.gz rspamd-eba15e9dce30c971aefb5b2f6cbf8d5690d6e427.zip |
[Minor] Mime_types: Check extension existence
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/mime_types.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua index 29470e4ea..981512a33 100644 --- a/src/plugins/lua/mime_types.lua +++ b/src/plugins/lua/mime_types.lua @@ -438,7 +438,7 @@ local function check_mime_type(task) local is_gen_split_rar = false if filename then local ext = gen_extension(filename) - is_gen_split_rar = string.match(ext, '^%d%d%d$') and arch:get_type() == 'rar' + is_gen_split_rar = ext and (string.match(ext, '^%d%d%d$')) and (arch:get_type() == 'rar') end local fl = arch:get_files_full(1000) @@ -454,7 +454,7 @@ local function check_mime_type(task) end if f['name'] then - if is_gen_split_rar and gen_extension(f['name']) == 'exe' then + if is_gen_split_rar and (gen_extension(f['name']) or '') == 'exe' then task:insert_result(settings['symbol_exe_in_gen_split_rar'], 1.0, f['name']) else check_filename(f['name'], nil, |