fix(app_actions): base_syscalls check for empty string

Signed-off-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
This commit is contained in:
Melissa Kilby 2023-02-23 23:14:56 +00:00 committed by poiana
parent 58dc60e58d
commit 0de9af9ed0

View File

@ -23,7 +23,9 @@ void extract_base_syscalls_names(const std::unordered_set<std::string>& base_sys
{ {
for (const std::string &ev : base_syscalls_names) for (const std::string &ev : base_syscalls_names)
{ {
if(ev.at(0) == '!') if (!ev.empty())
{
if (ev.at(0) == '!')
{ {
negative_names.insert(ev.substr(1, ev.size())); negative_names.insert(ev.substr(1, ev.size()));
} }
@ -32,6 +34,7 @@ void extract_base_syscalls_names(const std::unordered_set<std::string>& base_sys
positive_names.insert(ev); positive_names.insert(ev);
} }
} }
}
} }
static libsinsp::events::set<ppm_event_code> extract_rules_event_set(falco::app::state& s) static libsinsp::events::set<ppm_event_code> extract_rules_event_set(falco::app::state& s)