avoid segfault when reading beyond the provided number of lines

This commit is contained in:
Axel Kohlmeyer
2022-11-19 14:00:22 -05:00
parent 6c87236e7a
commit b39842ba23

View File

@ -275,6 +275,7 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint
for (int i = 0; i < n; i++) {
next = strchr(buf, '\n');
if (!next) error->all(FLERR, "Unexpected end of file while reading data section");
*next = '\0';
try {