mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-24 22:24:44 +02:00
IcingaDB#SerializeState(): limit execution_time and latency to 2^32-1
not to write higher values into Redis than the Icinga DB schema can hold. This fixes yet another potential Go daemon crash.
This commit is contained in:
parent
14b854d891
commit
c21e99a15c
@ -2651,8 +2651,8 @@ Dictionary::Ptr IcingaDB::SerializeState(const Checkable::Ptr& checkable)
|
|||||||
|
|
||||||
if (!cr->GetCommand().IsEmpty())
|
if (!cr->GetCommand().IsEmpty())
|
||||||
attrs->Set("check_commandline", FormatCommandLine(cr->GetCommand()));
|
attrs->Set("check_commandline", FormatCommandLine(cr->GetCommand()));
|
||||||
attrs->Set("execution_time", TimestampToMilliseconds(fmax(0.0, cr->CalculateExecutionTime())));
|
attrs->Set("execution_time", std::min((long long)UINT32_MAX, TimestampToMilliseconds(fmax(0.0, cr->CalculateExecutionTime()))));
|
||||||
attrs->Set("latency", TimestampToMilliseconds(cr->CalculateLatency()));
|
attrs->Set("latency", std::min((long long)UINT32_MAX, TimestampToMilliseconds(cr->CalculateLatency())));
|
||||||
attrs->Set("check_source", cr->GetCheckSource());
|
attrs->Set("check_source", cr->GetCheckSource());
|
||||||
attrs->Set("scheduling_source", cr->GetSchedulingSource());
|
attrs->Set("scheduling_source", cr->GetSchedulingSource());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user