From 59cf0df1d6a79df4071439ab6677f98d5fbe234c Mon Sep 17 00:00:00 2001 From: Charles Schlosser Date: Wed, 15 May 2024 16:14:32 +0000 Subject: [PATCH] SparseMatrix::insert add checks for valid indices --- Eigen/src/SparseCore/SparseMatrix.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 849970a9b..fd92ab076 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -563,6 +563,8 @@ class SparseMatrix : public SparseCompressedBase= 0 && j < m_outerSize && "invalid outer index"); + eigen_assert(i >= 0 && i < m_innerSize && "invalid inner index"); Index start = m_outerIndex[j]; Index end = isCompressed() ? m_outerIndex[j + 1] : start + m_innerNonZeros[j]; Index dst = start == end ? end : m_data.searchLowerIndex(start, end, i);