Unverified Commit 3070a110 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

guard against extracting too many elements from the MEAM library into the statically sized arrays

this will abort with a meaningful error message and people can fix up their LAMMPS binary as needed.
parent cb27d03c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -226,6 +226,9 @@ void PairMEAMC::coeff(int narg, char **arg)
  }
  nelements = narg - 4 - atom->ntypes;
  if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
  if (nelements > maxelt)
    error->all(FLERR,"Too many elements extracted from MEAM library. "
                      "Increase 'maxelt' in meam.h and recompile.");
  elements = new char*[nelements];
  mass = new double[nelements];