Skip to content
Snippets Groups Projects
Commit ae83ea5c authored by Matt Clarke_1's avatar Matt Clarke_1
Browse files

remove possibility of integer overflow in partitionfilter

parent 2afdbf0e
No related branches found
No related tags found
1 merge request!896remove possibility of integer overflow in partitionfilter
......@@ -20,10 +20,11 @@ PartitionFilter::PartitionFilter(time_point stop_time,
std::unique_ptr<Clock> clock)
: _stop_time(stop_time), _stop_leeway(stop_time_leeway),
_time_limit(time_limit), _clock(std::move(clock)) {
// Deal with potential overflow problem
// Deal with potential overflow problems
if (time_point::max() - _stop_time <= stop_time_leeway) {
_stop_time -= stop_time_leeway;
}
_status_occurrence_time = time_point::max() - _time_limit;
}
bool PartitionFilter::hasExceededTimeLimit() const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment