Make sure the duration is not negative (#16931)
Stelios Fragkakis committed
Feb 5, 2024 at 14:55 UTC
be23c6a07025645597b3f75f91fb234bdc76cdc0
1 file changed
+3
health/health_log.c
+3
@@ -112,6 +112,9 @@ inline ALARM_ENTRY* health_create_alarm_entry(
112
STRING *summary = rc->summary;
113
STRING *info = rc->info;
114
115
+ if (duration < 0)
116
+ duration = 0;
117
+
118
netdata_log_debug(D_HEALTH, "Health adding alarm log entry with id: %u", host->health_log.next_log_id);
119
120
ALARM_ENTRY *ae = callocz(1, sizeof(ALARM_ENTRY));