Skip to content

Commit

Permalink
Merge pull request idaholab#27290 from lindsayad/valgrind-fix-27231
Browse files Browse the repository at this point in the history
Limit _stage variable to prevent OOB access
  • Loading branch information
lindsayad authored Apr 5, 2024
2 parents f57cc6d + 263a7f8 commit 4781fca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions framework/src/timeintegrators/ExplicitSSPRungeKutta.C
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ ExplicitSSPRungeKutta::solve()
if (!converged)
return;
}

if (_stage == _n_stages)
// We made it to the end of the solve. We may call functions like computeTimeDerivatives later
// for postprocessing purposes in which case we need to ensure we're accessing our data
// correctly (e.g. not out-of-bounds)
--_stage;
}

bool
Expand Down

0 comments on commit 4781fca

Please sign in to comment.