We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb945fe commit 8c05158Copy full SHA for 8c05158
lib/icingadb/icingadb-utility.cpp
@@ -245,6 +245,12 @@ String IcingaDB::GetLowerCaseTypeNameDB(const ConfigObject::Ptr& obj)
245
}
246
247
long long IcingaDB::TimestampToMilliseconds(double timestamp) {
248
+ // In addition to the limit of 2^63 of the Icinga DB PostgreSQL schema,
249
+ // negative timestamps or years with more than four digits may cause problems.
250
+ if (timestamp <= 0.0 || timestamp > 2e11 /* 8307 AD */) {
251
+ return 0;
252
+ }
253
+
254
return static_cast<long long>(timestamp * 1000);
255
256
0 commit comments