From 8933203a20df1635bb468db8a7c222dd76032ab8 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 24 Mar 2014 04:02:12 +0000 Subject: [PATCH] [Numerics] Fix invalid dereference in SquareMatrix::factor The work array hasn't always been allocated, so taking its address isn't necessarily valid. Also, dlange doesn't use the work array in the '1' norm case anyway. --- src/numerics/SquareMatrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/numerics/SquareMatrix.cpp b/src/numerics/SquareMatrix.cpp index 9959515b9..3f0c20f26 100644 --- a/src/numerics/SquareMatrix.cpp +++ b/src/numerics/SquareMatrix.cpp @@ -134,7 +134,7 @@ int SquareMatrix::factor() if (useQR_) { return factorQR(); } - a1norm_ = ct_dlange('1', m_nrows, m_nrows, &(*(begin())), m_nrows, DATA_PTR(work)); + a1norm_ = ct_dlange('1', m_nrows, m_nrows, &(*(begin())), m_nrows, 0); integer n = static_cast(nRows()); int info=0; m_factored = 1;