fix(usperspace): webserver must not fail with input that exceeds the expected ranges

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
Leonardo Di Donato 2019-08-01 19:10:02 +00:00 committed by Lorenzo Fontana
parent c9cd6eebf7
commit 8c62ec5472

View File

@ -44,10 +44,16 @@ bool k8s_audit_handler::accept_data(falco_engine *engine,
std::list<json_event> jevts;
json j;
try {
try
{
j = json::parse(data);
}
catch (json::parse_error& e)
catch(json::parse_error &e)
{
errstr = string("Could not parse data: ") + e.what();
return false;
}
catch(json::out_of_range &e)
{
errstr = string("Could not parse data: ") + e.what();
return false;