diff --git a/CHANGES b/CHANGES index 5aad3b2c2b..58ccc5749f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +4.2.0-dev.64 | 2021-08-03 10:23:41 +0100 + + * Under certain circumstances, Zeek processes could get into an infinite looping state inside RotationTimer. + This is fixed by handling special cases of rotation happening exactly on the time boundary, and fixing + a special case of timer expiration. Fixes GH-1689. (Sowmya Ramapatruni, Corelight) + 4.2.0-dev.62 | 2021-08-03 10:21:18 +0100 * Fix some HTTP evasions. Now HTTP packets are correctly parsed, when CRLF is missing on a multipart diff --git a/VERSION b/VERSION index 754772b8fc..1180e1a682 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.0-dev.62 +4.2.0-dev.64 diff --git a/src/Timer.cc b/src/Timer.cc index e8f47cfbb4..ecf56dd057 100644 --- a/src/Timer.cc +++ b/src/Timer.cc @@ -152,7 +152,7 @@ void PQ_TimerMgr::Expire() int PQ_TimerMgr::DoAdvance(double new_t, int max_expire) { Timer* timer = Top(); - for ( num_expired = 0; (num_expired < max_expire || max_expire == 0) && + for ( num_expired = 0; (num_expired < max_expire ) && timer && timer->Time() <= new_t; ++num_expired ) { last_timestamp = timer->Time(); diff --git a/src/util.cc b/src/util.cc index 260866d30f..28b5f34a73 100644 --- a/src/util.cc +++ b/src/util.cc @@ -885,9 +885,10 @@ double calc_next_rotate(double current, double interval, double base) double startofday = mktime(&t); // current < startofday + base + i * interval <= current + interval - return startofday + base + + double delta_t = startofday + base + ceil((current - startofday - base) / interval) * interval - current; + return delta_t > 0.0 ? delta_t: interval; } void terminate_processing()