Skip to content

Commit f24797e

Browse files
authored
Merge pull request #378 from vladimir-ch/lapack/lantr-avoid-outofbound-write
LAPACK: avoid out-of-bound write in ?LANTR
2 parents 88d84a6 + 2ecd3c6 commit f24797e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

SRC/clantr.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ REAL FUNCTION CLANTR( NORM, UPLO, DIAG, M, N, A, LDA,
287287
END IF
288288
ELSE
289289
IF( LSAME( DIAG, 'U' ) ) THEN
290-
DO 210 I = 1, N
290+
DO 210 I = 1, MIN( M, N )
291291
WORK( I ) = ONE
292292
210 CONTINUE
293293
DO 220 I = N + 1, M

SRC/dlantr.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ DOUBLE PRECISION FUNCTION DLANTR( NORM, UPLO, DIAG, M, N, A, LDA,
285285
END IF
286286
ELSE
287287
IF( LSAME( DIAG, 'U' ) ) THEN
288-
DO 210 I = 1, N
288+
DO 210 I = 1, MIN( M, N )
289289
WORK( I ) = ONE
290290
210 CONTINUE
291291
DO 220 I = N + 1, M

SRC/slantr.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ REAL FUNCTION SLANTR( NORM, UPLO, DIAG, M, N, A, LDA,
285285
END IF
286286
ELSE
287287
IF( LSAME( DIAG, 'U' ) ) THEN
288-
DO 210 I = 1, N
288+
DO 210 I = 1, MIN( M, N )
289289
WORK( I ) = ONE
290290
210 CONTINUE
291291
DO 220 I = N + 1, M

SRC/zlantr.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ DOUBLE PRECISION FUNCTION ZLANTR( NORM, UPLO, DIAG, M, N, A, LDA,
287287
END IF
288288
ELSE
289289
IF( LSAME( DIAG, 'U' ) ) THEN
290-
DO 210 I = 1, N
290+
DO 210 I = 1, MIN( M, N )
291291
WORK( I ) = ONE
292292
210 CONTINUE
293293
DO 220 I = N + 1, M

0 commit comments

Comments
 (0)