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 May 3, 2024
1 parent 74d9dcd commit d609ada
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions parsec/data_dist/matrix/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void parsec_tiled_matrix_init( parsec_tiled_matrix_t *tdesc,
tdesc->tileld = (storage == PARSEC_MATRIX_TILE) ? mb : lm;
tdesc->mb = mb;
tdesc->nb = nb;
tdesc->bsiz = mb * nb;
tdesc->bsiz = (size_t)mb * nb;

/* Large matrix parameters */
tdesc->lm = lm;
Expand Down Expand Up @@ -304,7 +304,8 @@ int parsec_tiled_matrix_data_read(parsec_tiled_matrix_t *tdesc, char *filename)
parsec_data_t* data;
FILE *tmpf;
char *buf;
int i, j, k, ret;
int i, j, k;
size_t ret;
uint32_t myrank = tdesc->super.myrank;
int eltsize = parsec_datadist_getsizeoftype( tdesc->mtype );

Expand Down
2 changes: 1 addition & 1 deletion parsec/data_dist/matrix/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ typedef struct parsec_tiled_matrix_s {
int tileld; /**< leading dimension of each tile (Should be a function depending on the row) */
int mb; /**< number of rows in a tile */
int nb; /**< number of columns in a tile */
int bsiz; /**< size in elements including padding of a tile - derived parameter */
size_t bsiz; /**< size in elements including padding of a tile - derived parameter */
int lm; /**< number of rows of the entire matrix */
int ln; /**< number of columns of the entire matrix */
int lmt; /**< number of tile rows of the entire matrix - derived parameter */
Expand Down

0 comments on commit d609ada

Please sign in to comment.