Skip to content

Commit

Permalink
Fix overflow when calling parsec_data_create
Browse files Browse the repository at this point in the history
  • Loading branch information
Qinglei Cao committed Mar 15, 2024
1 parent 4f76b6d commit 149097d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion parsec/data_dist/matrix/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ parsec_tiled_matrix_create_data(parsec_tiled_matrix_t* matrix,
assert( pos <= matrix->nb_local_tiles );
return parsec_data_create( matrix->data_map + pos,
&(matrix->super), key, ptr,
matrix->bsiz * parsec_datadist_getsizeoftype(matrix->mtype),
(size_t)matrix->bsiz * parsec_datadist_getsizeoftype(matrix->mtype),
PARSEC_DATA_FLAG_PARSEC_MANAGED);
}

Expand Down Expand Up @@ -95,6 +95,7 @@ void parsec_tiled_matrix_init( parsec_tiled_matrix_t *tdesc,
tdesc->mb = mb;
tdesc->nb = nb;
tdesc->bsiz = mb * nb;
assert((size_t)mb * nb <= INT_MAX);

/* Large matrix parameters */
tdesc->lm = lm;
Expand Down

0 comments on commit 149097d

Please sign in to comment.