From 263a7f8e61c04b07e5da6d2b7883c48a738ade1c Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 4 Apr 2024 18:54:48 -0700 Subject: [PATCH] Limit _stage variable to prevent OOB access Refs #27231 --- framework/src/timeintegrators/ExplicitSSPRungeKutta.C | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/framework/src/timeintegrators/ExplicitSSPRungeKutta.C b/framework/src/timeintegrators/ExplicitSSPRungeKutta.C index 91563677f8bc..45ecd23ef490 100644 --- a/framework/src/timeintegrators/ExplicitSSPRungeKutta.C +++ b/framework/src/timeintegrators/ExplicitSSPRungeKutta.C @@ -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