mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
IcingaDB::PrepareObject(): cut off (null) negative Notification#times.{begin,end} not to crash Go daemon
At least our PostgreSQL schema enforces positive values.
This commit is contained in:
parent
415b810abf
commit
dccb678882
@ -1386,11 +1386,11 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
|
|||||||
auto begin (notification->GetTimes()->Get("begin"));
|
auto begin (notification->GetTimes()->Get("begin"));
|
||||||
auto end (notification->GetTimes()->Get("end"));
|
auto end (notification->GetTimes()->Get("end"));
|
||||||
|
|
||||||
if (begin != Empty) {
|
if (begin != Empty && (double)begin >= 0) {
|
||||||
attributes->Set("times_begin", std::round((double)begin));
|
attributes->Set("times_begin", std::round((double)begin));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (end != Empty) {
|
if (end != Empty && (double)end >= 0) {
|
||||||
attributes->Set("times_end", std::round((double)end));
|
attributes->Set("times_end", std::round((double)end));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user