avoid overflows when computing memory offsets and allocating memory

This commit is contained in:
Axel Kohlmeyer
2021-02-06 18:12:47 -05:00
parent 1380b7b142
commit 77402bdbc8
13 changed files with 28 additions and 27 deletions

View File

@ -258,7 +258,7 @@ void ComputeOrientOrderAtom::compute_peratom()
double **x = atom->x;
int *mask = atom->mask;
memset(&qnarray[0][0],0,nmax*ncol*sizeof(double));
memset(&qnarray[0][0],0,sizeof(double)*nmax*ncol);
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];