Skip to content
Snippets Groups Projects
Verified Commit 047be592 authored by baptiste.coudray's avatar baptiste.coudray
Browse files

Fixed buffer overflow

parent 305f8a70
No related branches found
No related tags found
No related merge requests found
......@@ -496,7 +496,7 @@ static envelope_t get_outer_envelope_2d(struct dispatch_context *dc, int thickne
/* Neighbour send north-east cell, which correspond to south-west cell */
int dimensions[2] = {thickness, thickness};
int start_y = dc->chunks_info[dest_source].y;
int start_x = dc->chunks_info[dest_source].x + dc->chunk_info[dest_source].dimensions[1] - thickness;
int start_x = dc->chunks_info[dest_source].x + dc->chunks_info[dest_source].dimensions[1] - thickness;
chunk_info_init(&outer_envelope.south_west, dc->type, dimensions, start_y, start_x, true);
MPI_Irecv(outer_envelope.south_west.data, outer_envelope.south_west.count * dc->type, MPI_UINT8_T, dest_source,
NORTH_EAST_CELLS_TAG, MPI_COMM_WORLD, &requests[i_request++]);
......@@ -514,8 +514,8 @@ static envelope_t get_outer_envelope_2d(struct dispatch_context *dc, int thickne
/* Neighbour send south-east cell, which correspond to north-west cell */
int dimensions[2] = {thickness, thickness};
int start_y = dc->chunks_info[dest_source].y + dc->chunk_info[dest_source].dimensions[0] - thickness;
int start_x = dc->chunks_info[dest_source].x + dc->chunk_info[dest_source].dimensions[1] - thickness;
int start_y = dc->chunks_info[dest_source].y + dc->chunks_info[dest_source].dimensions[0] - thickness;
int start_x = dc->chunks_info[dest_source].x + dc->chunks_info[dest_source].dimensions[1] - thickness;
chunk_info_init(&outer_envelope.north_west, dc->type, dimensions, start_y, start_x, true);
MPI_Irecv(outer_envelope.north_west.data, outer_envelope.north_west.count * dc->type, MPI_INT8_T, dest_source,
SOUTH_EAST_CELLS_TAG, MPI_COMM_WORLD, &requests[i_request++]);
......
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