Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 27, 2024
1 parent eea944e commit e77f5f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions source/api_cc/src/commonPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ void NeighborListDataPT::copy_from_nlist(const InputNlist& inlist,
int jnum = inlist.numneigh[ii];
numneigh[ii] = inlist.numneigh[ii];
unsigned long start_loc = ii * max_num_neighbors;

Check failure

Code scanning / CodeQL

Multiplication result converted to larger type High

Multiplication result may overflow 'int' before it is converted to 'unsigned long'.
memcpy(&jlist[start_loc], inlist.firstneigh[ii],
jnum * sizeof(int));
memcpy(&jlist[start_loc], inlist.firstneigh[ii], jnum * sizeof(int));
}
}
#endif

0 comments on commit e77f5f3

Please sign in to comment.