Skip to content

Commit cc1a3a0

Browse files
Fix buffer overflow in LM transition model LoadRestart causing segfault #2606
1 parent 4300abd commit cc1a3a0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

SU2_CFD/src/solvers/CTransLMSolver.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,11 @@ void CTransLMSolver::LoadRestart(CGeometry** geometry, CSolver*** solver, CConfi
546546

547547
const auto index = counter * Restart_Vars[1] + skipVars;
548548
for (auto iVar = 0u; iVar < nVar; iVar++) nodes->SetSolution(iPoint_Local, iVar, Restart_Data[index + iVar]);
549-
nodes->SetIntermittencySep(iPoint_Local, Restart_Data[index + 2]);
550-
nodes->SetIntermittencyEff(iPoint_Local, Restart_Data[index + 3]);
549+
550+
/*--- Note: Intermittency_Sep and Intermittency_Eff are derived variables computed in Postprocessing,
551+
* not solution variables stored in the restart file. They will be recomputed after this function
552+
* completes. Previously, this code incorrectly tried to read them from indices [index+2] and [index+3],
553+
* which caused a buffer overflow since only nVar=2 solution variables are stored per point. ---*/
551554

552555
/*--- Increment the overall counter for how many points have been loaded. ---*/
553556
counter++;

0 commit comments

Comments
 (0)