mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
analyzer/files: handle non-analyzer names in describe_file()
When a fa_file object is created through the use of Input::add_analysis(), the fa_file's source is likely not valid representation of an analyzer's tag and a Files::describe() should not error and instead return an empty description. Add a new Analyzer::is_tag() helper that can be used to pre-check `f$source`.
This commit is contained in:
parent
1e06c8bfda
commit
85ce48eb1e
7 changed files with 97 additions and 8 deletions
|
@ -499,6 +499,9 @@ function all_registered_mime_types(): table[Files::Tag] of set[string]
|
|||
|
||||
function describe(f: fa_file): string
|
||||
{
|
||||
if ( ! Analyzer::has_tag(f$source) )
|
||||
return "";
|
||||
|
||||
local tag = Analyzer::get_tag(f$source);
|
||||
if ( tag !in registered_protocols )
|
||||
return "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue