LAPACK Archives

[Lapack] [BUG OF LAPACKE] lapacke_zstegr_work doesn't check ldz correctl

Hi Lapack Team!

I think I've found a bug. In the C interface of lapacke_zstegr_work, ldz 
is not checked correctly. In the patch attached, you can see that ldz is 
currently used to compared with *m, which is a variable that may not be 
initialized. The correct way should be checking it with ldz_t.

-------------- next part --------------
diff --git a/lapacke/src/lapacke_zstegr_work.c 
index ad56b96..9f4b2d0 100644
--- a/lapacke/src/lapacke_zstegr_work.c
+++ b/lapacke/src/lapacke_zstegr_work.c
@@ -55,7 +55,7 @@ lapack_int LAPACKE_zstegr_work( int matrix_order, char jobz, 
char range,
         lapack_int ldz_t = MAX(1,n);
         lapack_complex_double* z_t = NULL;
         /* Check leading dimension(s) */
-        if( ldz < *m ) {
+        if( LAPACKE_lsame( jobz, 'v' ) && ldz < ldz_t || ldz < 1 ) {
             info = -15;
             LAPACKE_xerbla( "LAPACKE_zstegr_work", info );
             return info;

<Prev in Thread] Current Thread [Next in Thread>

For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or