Skip to content

Commit 5697993

Browse files
committed
Adress lgtm problem of possible overflow before array eval.
1 parent 5062c52 commit 5697993

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Common/src/geometry/CPhysicalGeometry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7476,7 +7476,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) {
74767476
su2double min_norm = 0.0;
74777477

74787478
vector<su2double> Buffer_Send_RefNode(nDim, 1e300),
7479-
Buffer_Recv_RefNode(size*nDim);
7479+
Buffer_Recv_RefNode(static_cast<size_t>(size)*nDim);
74807480

74817481
/*-------------------------------------------------------------------------------------------*/
74827482
/*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/
@@ -7525,7 +7525,7 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(CConfig *config) {
75257525
for (int iRank = 0; iRank < size; iRank++) {
75267526

75277527
/*--- Get the norm of the current Point. ---*/
7528-
auto norm = GeometryToolbox::SquaredNorm(nDim, &Buffer_Recv_RefNode[iRank*nDim]);
7528+
auto norm = GeometryToolbox::SquaredNorm(nDim, &Buffer_Recv_RefNode[static_cast<size_t>(iRank)*nDim]);
75297529

75307530
/*--- Check if new unique reference node is found. ---*/
75317531
if (norm < min_norm || iRank == 0) {

0 commit comments

Comments
 (0)