diff --git a/MathLib/LinAlg/Sparse/CRSMatrix.h b/MathLib/LinAlg/Sparse/CRSMatrix.h
index d4223919193bf04036b0e1ebcae2fbe8ff06fd3a..bd141bc4a6fac8db301a12b5bdd009dc60f67562 100644
--- a/MathLib/LinAlg/Sparse/CRSMatrix.h
+++ b/MathLib/LinAlg/Sparse/CRSMatrix.h
@@ -245,7 +245,7 @@ protected:
 	{
 		// copy the data
 		IDX_TYPE const* row_ptr(rhs.getRowPtrArray());
-		for	(IDX_TYPE k(0); k<MatrixBase::_n_rows; k++) {
+		for	(IDX_TYPE k(0); k<=MatrixBase::_n_rows; k++) {
 			_row_ptr[k] = row_ptr[k];
 		}