Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9a3b84d9 authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

Check return value of mallocs in check_zmatrices() and prevent overflows

parent 903ad11c
No related branches found
No related tags found
1 merge request!331Check return value of mallocs in check_zmatrices() and prevent overflows
...@@ -162,8 +162,11 @@ int check_zmatrices( run_arg_list_t *args, cham_uplo_t uplo, CHAM_desc_t *descA, ...@@ -162,8 +162,11 @@ int check_zmatrices( run_arg_list_t *args, cham_uplo_t uplo, CHAM_desc_t *descA,
CHAMELEON_Complex64_t *B = NULL; CHAMELEON_Complex64_t *B = NULL;
if ( rank == 0 ) { if ( rank == 0 ) {
A = (CHAMELEON_Complex64_t *)malloc(LDA*N*sizeof(CHAMELEON_Complex64_t)); A = (CHAMELEON_Complex64_t *)malloc((size_t)(LDA) * (size_t)(N) * sizeof(CHAMELEON_Complex64_t));
B = (CHAMELEON_Complex64_t *)malloc(LDB*N*sizeof(CHAMELEON_Complex64_t)); B = (CHAMELEON_Complex64_t *)malloc((size_t)(LDB) * (size_t)(N) * sizeof(CHAMELEON_Complex64_t));
if ( (A == NULL) || (B == NULL) ) {
return CHAMELEON_ERR_OUT_OF_RESOURCES;
}
} }
/* Converts the matrices to LAPACK layout in order to compare them on the main process */ /* Converts the matrices to LAPACK layout in order to compare them on the main process */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment