Skip to content

Commit

Permalink
Fix potential out-of-bounds read in Model::checkFinite (#2232)
Browse files Browse the repository at this point in the history
Fix potential out-of-bounds read and incorrect parameter IDs in error messages in Model::checkFinite: `dwdp_` has size `nw` x `np`, not `nw` x `nplist`.
  • Loading branch information
dweindl authored Dec 12, 2023
1 parent ecbae3f commit 1dad722
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ int Model::checkFinite(SUNMatrix m, ModelQuantity model_quantity, realtype t)
if (hasExpressionIds())
row_id += " " + getExpressionIds()[row];
if (hasParameterIds())
col_id += " " + getParameterIds()[plist(gsl::narrow<int>(col))];
col_id += " " + getParameterIds()[col];
break;
default:
break;
Expand Down

0 comments on commit 1dad722

Please sign in to comment.