mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-10 11:09:37 +00:00
fix(userspace): handle exceptions for process_k8s_audit_event
This fix has two major points in it: - when `std::stoll` is used in parse_as_int64 handle all the exceptions it can throw (https://en.cppreference.com/w/cpp/string/basic_string/stol) - when `process_k8s_audit_event` an eventual exception in it does not stop the webserver process. This is done by doing a catch all handle outside it and by logging an error message to the caller as well as in stderr Signed-off-by: Lorenzo Fontana <lo@linux.com>
This commit is contained in:
@@ -281,7 +281,11 @@ bool json_event_value::parse_as_int64(int64_t &intval, const std::string &val)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (std::invalid_argument &e)
|
||||
catch(std::out_of_range &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (std::invalid_argument &)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user