1 Description: LAPACKE_dlansy et al cause segfault with 1-norm (upstream bug #135)
2 Origin: upstream, commit: r1587
3 Bug: http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4793
4 Reviewed-by: Sébastien Villemot <sebastien@debian.org>
5 Last-Update: 2015-10-31
7 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
8 --- a/lapacke/src/lapacke_clanhe.c
9 +++ b/lapacke/src/lapacke_clanhe.c
10 @@ -51,7 +51,7 @@ float LAPACKE_clanhe( int matrix_order,
12 /* Allocate memory for working array(s) */
13 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
14 - LAPACKE_lsame( norm, '0' ) ) {
15 + LAPACKE_lsame( norm, 'O' ) ) {
16 work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
18 info = LAPACK_WORK_MEMORY_ERROR;
19 @@ -62,7 +62,7 @@ float LAPACKE_clanhe( int matrix_order,
20 res = LAPACKE_clanhe_work( matrix_order, norm, uplo, n, a, lda, work );
21 /* Release memory and exit */
22 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
23 - LAPACKE_lsame( norm, '0' ) ) {
24 + LAPACKE_lsame( norm, 'O' ) ) {
28 --- a/lapacke/src/lapacke_clansy.c
29 +++ b/lapacke/src/lapacke_clansy.c
30 @@ -51,7 +51,7 @@ float LAPACKE_clansy( int matrix_order,
32 /* Allocate memory for working array(s) */
33 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
34 - LAPACKE_lsame( norm, '0' ) ) {
35 + LAPACKE_lsame( norm, 'O' ) ) {
36 work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
38 info = LAPACK_WORK_MEMORY_ERROR;
39 @@ -62,7 +62,7 @@ float LAPACKE_clansy( int matrix_order,
40 res = LAPACKE_clansy_work( matrix_order, norm, uplo, n, a, lda, work );
41 /* Release memory and exit */
42 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
43 - LAPACKE_lsame( norm, '0' ) ) {
44 + LAPACKE_lsame( norm, 'O' ) ) {
48 --- a/lapacke/src/lapacke_clantr.c
49 +++ b/lapacke/src/lapacke_clantr.c
50 @@ -52,7 +52,7 @@ float LAPACKE_clantr( int matrix_order,
52 /* Allocate memory for working array(s) */
53 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
54 - LAPACKE_lsame( norm, '0' ) ) {
55 + LAPACKE_lsame( norm, 'O' ) ) {
56 work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,m) );
58 info = LAPACK_WORK_MEMORY_ERROR;
59 @@ -64,7 +64,7 @@ float LAPACKE_clantr( int matrix_order,
61 /* Release memory and exit */
62 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
63 - LAPACKE_lsame( norm, '0' ) ) {
64 + LAPACKE_lsame( norm, 'O' ) ) {
68 --- a/lapacke/src/lapacke_dlansy.c
69 +++ b/lapacke/src/lapacke_dlansy.c
70 @@ -51,7 +51,7 @@ double LAPACKE_dlansy( int matrix_order,
72 /* Allocate memory for working array(s) */
73 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
74 - LAPACKE_lsame( norm, '0' ) ) {
75 + LAPACKE_lsame( norm, 'O' ) ) {
76 work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
78 info = LAPACK_WORK_MEMORY_ERROR;
79 @@ -62,7 +62,7 @@ double LAPACKE_dlansy( int matrix_order,
80 res = LAPACKE_dlansy_work( matrix_order, norm, uplo, n, a, lda, work );
81 /* Release memory and exit */
82 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
83 - LAPACKE_lsame( norm, '0' ) ) {
84 + LAPACKE_lsame( norm, 'O' ) ) {
88 --- a/lapacke/src/lapacke_dlantr.c
89 +++ b/lapacke/src/lapacke_dlantr.c
90 @@ -52,7 +52,7 @@ double LAPACKE_dlantr( int matrix_order,
92 /* Allocate memory for working array(s) */
93 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
94 - LAPACKE_lsame( norm, '0' ) ) {
95 + LAPACKE_lsame( norm, 'O' ) ) {
96 work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) );
98 info = LAPACK_WORK_MEMORY_ERROR;
99 @@ -64,7 +64,7 @@ double LAPACKE_dlantr( int matrix_order,
101 /* Release memory and exit */
102 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
103 - LAPACKE_lsame( norm, '0' ) ) {
104 + LAPACKE_lsame( norm, 'O' ) ) {
105 LAPACKE_free( work );
108 --- a/lapacke/src/lapacke_slansy.c
109 +++ b/lapacke/src/lapacke_slansy.c
110 @@ -51,7 +51,7 @@ float LAPACKE_slansy( int matrix_order,
112 /* Allocate memory for working array(s) */
113 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
114 - LAPACKE_lsame( norm, '0' ) ) {
115 + LAPACKE_lsame( norm, 'O' ) ) {
116 work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
118 info = LAPACK_WORK_MEMORY_ERROR;
119 @@ -62,7 +62,7 @@ float LAPACKE_slansy( int matrix_order,
120 res = LAPACKE_slansy_work( matrix_order, norm, uplo, n, a, lda, work );
121 /* Release memory and exit */
122 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
123 - LAPACKE_lsame( norm, '0' ) ) {
124 + LAPACKE_lsame( norm, 'O' ) ) {
125 LAPACKE_free( work );
128 --- a/lapacke/src/lapacke_slantr.c
129 +++ b/lapacke/src/lapacke_slantr.c
130 @@ -52,7 +52,7 @@ float LAPACKE_slantr( int matrix_order,
132 /* Allocate memory for working array(s) */
133 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
134 - LAPACKE_lsame( norm, '0' ) ) {
135 + LAPACKE_lsame( norm, 'O' ) ) {
136 work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,m) );
138 info = LAPACK_WORK_MEMORY_ERROR;
139 @@ -64,7 +64,7 @@ float LAPACKE_slantr( int matrix_order,
141 /* Release memory and exit */
142 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
143 - LAPACKE_lsame( norm, '0' ) ) {
144 + LAPACKE_lsame( norm, 'O' ) ) {
145 LAPACKE_free( work );
148 --- a/lapacke/src/lapacke_zlanhe.c
149 +++ b/lapacke/src/lapacke_zlanhe.c
150 @@ -51,7 +51,7 @@ double LAPACKE_zlanhe( int matrix_order,
152 /* Allocate memory for working array(s) */
153 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
154 - LAPACKE_lsame( norm, '0' ) ) {
155 + LAPACKE_lsame( norm, 'O' ) ) {
156 work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
158 info = LAPACK_WORK_MEMORY_ERROR;
159 @@ -62,7 +62,7 @@ double LAPACKE_zlanhe( int matrix_order,
160 res = LAPACKE_zlanhe_work( matrix_order, norm, uplo, n, a, lda, work );
161 /* Release memory and exit */
162 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
163 - LAPACKE_lsame( norm, '0' ) ) {
164 + LAPACKE_lsame( norm, 'O' ) ) {
165 LAPACKE_free( work );
168 --- a/lapacke/src/lapacke_zlansy.c
169 +++ b/lapacke/src/lapacke_zlansy.c
170 @@ -51,7 +51,7 @@ double LAPACKE_zlansy( int matrix_order,
172 /* Allocate memory for working array(s) */
173 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
174 - LAPACKE_lsame( norm, '0' ) ) {
175 + LAPACKE_lsame( norm, 'O' ) ) {
176 work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,n) );
178 info = LAPACK_WORK_MEMORY_ERROR;
179 @@ -62,7 +62,7 @@ double LAPACKE_zlansy( int matrix_order,
180 res = LAPACKE_zlansy_work( matrix_order, norm, uplo, n, a, lda, work );
181 /* Release memory and exit */
182 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
183 - LAPACKE_lsame( norm, '0' ) ) {
184 + LAPACKE_lsame( norm, 'O' ) ) {
185 LAPACKE_free( work );
188 --- a/lapacke/src/lapacke_zlantr.c
189 +++ b/lapacke/src/lapacke_zlantr.c
190 @@ -52,7 +52,7 @@ double LAPACKE_zlantr( int matrix_order,
192 /* Allocate memory for working array(s) */
193 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
194 - LAPACKE_lsame( norm, '0' ) ) {
195 + LAPACKE_lsame( norm, 'O' ) ) {
196 work = (double*)LAPACKE_malloc( sizeof(double) * MAX(1,m) );
198 info = LAPACK_WORK_MEMORY_ERROR;
199 @@ -64,7 +64,7 @@ double LAPACKE_zlantr( int matrix_order,
201 /* Release memory and exit */
202 if( LAPACKE_lsame( norm, 'i' ) || LAPACKE_lsame( norm, '1' ) ||
203 - LAPACKE_lsame( norm, '0' ) ) {
204 + LAPACKE_lsame( norm, 'O' ) ) {
205 LAPACKE_free( work );