Skip to content

Fix potential out-of-bounds access in TimeFilter - #2532

Merged
paulromano merged 2 commits into
openmc-dev:developfrom
paulromano:time-filter-fix
Jun 11, 2023
Merged

paulromano merged 2 commits into
openmc-dev:developfrom
paulromano:time-filter-fix

Conversation

@paulromano

Copy link
Copy Markdown
Contributor

@HunterBelanger pointed out to me that there is a potential for an out-of-bounds error due to the lack of a check in TimeFilter::get_all_bins. Namely, for collision estimator/surface tallies, we don't check that the ending time of a particle's track is within the time bin range. This PR simply adds that check.

@HunterBelanger HunterBelanger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than my one minor comment, it looks like this should fix the problem. Thanks @paulromano for submitting this fix.

Comment thread src/tallies/filter_time.cpp Outdated
@paulromano
paulromano merged commit bc4e951 into openmc-dev:develop Jun 11, 2023
@paulromano
paulromano deleted the time-filter-fix branch June 11, 2023 20:05
apingegno pushed a commit to apingegno/openmc that referenced this pull request May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants