From 1dad72247207507d647dce89f290f0beaa65b14d Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 12 Dec 2023 20:54:46 +0100 Subject: [PATCH] Fix potential out-of-bounds read in Model::checkFinite (#2232) 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`. --- src/model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model.cpp b/src/model.cpp index 218870cafe..3c78802731 100644 --- a/src/model.cpp +++ b/src/model.cpp @@ -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(col))]; + col_id += " " + getParameterIds()[col]; break; default: break;