update(userspace): falco webserver must catch json type errors (exceptions)

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

View File

@ -53,7 +53,16 @@ bool k8s_audit_handler::accept_data(falco_engine *engine,
return false;
}
if(!engine->parse_k8s_audit_json(j, jevts))
bool ok;
try
{
ok = engine->parse_k8s_audit_json(j, jevts);
}
catch(json::type_error &e)
{
ok = false;
}
if(!ok)
{
errstr = string("Data not recognized as a k8s audit event");
return false;