diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2024-02-05 14:55:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 14:55:15 +0200 |
commit | be23c6a07025645597b3f75f91fb234bdc76cdc0 (patch) | |
tree | fabd3b89f8f5bd9f72754f14cb76baa1952bf4dd | |
parent | 188c41feb3632cc7fbbb1b6e1b2081a39493ae28 (diff) |
Make sure the duration is not negative (#16931)
-rw-r--r-- | health/health_log.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/health/health_log.c b/health/health_log.c index 8efc6e2e59..8839b2da5c 100644 --- a/health/health_log.c +++ b/health/health_log.c @@ -112,6 +112,9 @@ inline ALARM_ENTRY* health_create_alarm_entry( STRING *summary = rc->summary; STRING *info = rc->info; + if (duration < 0) + duration = 0; + netdata_log_debug(D_HEALTH, "Health adding alarm log entry with id: %u", host->health_log.next_log_id); ALARM_ENTRY *ae = callocz(1, sizeof(ALARM_ENTRY)); |