Fix out-of-bounds memory access in CvodesIntegrator::getErrorInfo
Out-of-bounds memory was being accessed in cases where the system had fewer state variables than the specified maximum number of error estimates to display.
This commit is contained in:
parent
de1884db71
commit
4049bb4bb2
1 changed files with 1 additions and 0 deletions
|
|
@ -465,6 +465,7 @@ string CVodesIntegrator::getErrorInfo(int N)
|
|||
N_VDestroy(errs);
|
||||
N_VDestroy(errw);
|
||||
|
||||
N = std::min(N, static_cast<int>(m_neq));
|
||||
sort(weightedErrors.begin(), weightedErrors.end());
|
||||
stringstream s;
|
||||
for (int i=0; i<N; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue