You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (int i = 0; i < NMix; ++i) {
for (int j = 0; j <= NMix; ++j) { // ← bug here
auto const &wmgasJ = wm->gaps[iGap].gases[j];
// ...
}
}
The valid indices for gaps[iGap].gases are 0 through NMix - 1. However, the condition j <= NMix allows j to reach NMix on the last iteration, causing gases[NMix] to be accessed, which is one element past the end of the array. This seems an out-of-bounds memory access.
Issue overview
gaps[iGap].gasesare0throughNMix - 1. However, the conditionj <= NMixallowsjto reachNMixon the last iteration, causinggases[NMix]to be accessed, which is one element past the end of the array. This seems an out-of-bounds memory access.Operating System (Multiple choices)
Windows
Operating System Version
11
Version of EnergyPlus
26.01
Unmethours link or helpdesk ticket number
N/A
Defect file
No response