bugfix for fix property/atom

Hello
    I stumbled into a small bug in fix_property_atom.cpp. A segfault
occurs if the user asks LAMMPS to read a data file containing the
wrong number of atoms in the custom data section. (See attached
example: system.data, run.in. I also attached a new
fix_property_atom.cpp based on lammps-15Dec15. Diff below)
    Happy holidays

Andrew

fix_property_atom.cpp

225,226c225
< bool read_failure = (values[0] == NULL);
< for (j = 1; j < nwords; j++) {

fix_property_atom.cpp (18.4 KB)

run.in (959 Bytes)

system.data (886 Bytes)

Hello
    I stumbled into a small bug in fix_property_atom.cpp. A segfault
occurs if the user asks LAMMPS to read a data file containing the
wrong number of atoms in the custom data section. (See attached
example: system.data, run.in. I also attached a new
fix_property_atom.cpp based on lammps-15Dec15. Diff below)

​hi andrew,

i've integrated your proposed change with some small modifications into
LAMMPS-ICMS.

due to the "optimistic" nature of the data file format, reading incorrectly
formatted or inconsistent data files can often lead to ​such segfaults and
not all of them are as easily caught as the one you ran across. i
personally consider this a design flaw of the data file format (if it had
properly tagged, self-descriptive sections, with more strict formatting
requirements, this could be avoided and the files more easily validated and
parsed, especially by external tools).

unfortunately, i have not yet found an argument to convince steve, that
this is worth the effort (and breaking backward compatibility).

axel.