From b39842ba23bd071d4a92efe0d994bb05dae6e397 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 19 Nov 2022 14:00:22 -0500 Subject: [PATCH] avoid segfault when reading beyond the provided number of lines --- src/fix_property_atom.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 68440e4d58..24704a12ad 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -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 {