From bc4e95127c4bbbe1b98557debfbc5e689aa6690a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 11 Jun 2023 15:05:16 -0500 Subject: [PATCH] Fix potential out-of-bounds access in TimeFilter (#2532) --- src/tallies/filter_time.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tallies/filter_time.cpp b/src/tallies/filter_time.cpp index 787acc49e..0378aa28d 100644 --- a/src/tallies/filter_time.cpp +++ b/src/tallies/filter_time.cpp @@ -80,10 +80,11 @@ void TimeFilter::get_all_bins( if (t_end < bins_[i_bin + 1]) break; } - } else { + } else if (t_end < bins_.back()) { // ------------------------------------------------------------------------- // For collision estimator or surface tallies, find a match based on the // exact time of the particle + const auto i_bin = lower_bound_index(bins_.begin(), bins_.end(), t_end); match.bins_.push_back(i_bin); match.weights_.push_back(1.0);