Added safety check for fitting group in anaeig.
authorJan Henning Peters <jpeters@gwdg.de>
Mon, 10 Feb 2014 17:53:32 +0000 (18:53 +0100)
committerCarsten Kutzner <ckutzne@gwdg.de>
Tue, 11 Feb 2014 09:11:01 +0000 (10:11 +0100)
commitdd2f13a0570ba46b9126ae14a7088ffb7da6990e
tree2164f5669ea934077dc5f25c656f61cb5dad1dd5
parenta4c5fb33614c0a8e0d6b739bbd41a45a3900003b
Added safety check for fitting group in anaeig.

Previously, g_anaeig would not check the number of atoms in the selected
fit group against the number of atoms in the reference structure if this
was read from the eigenvector file (g_covar adds the reference structure
to the eigenvector file if fit and analysis group are identitcal). As a
result, anaeig would run out of bounds when selecting the atoms for
fitting, reading random values from memory.

This simple check should prevent this behaviour by terminating anaeig
with a fatal error similar to the one that is invoked if the group
selected for analysis has an incorrect number of atoms.

Change-Id: I63a1e1629144e539808d95d867e0ad0673480fdf
src/tools/gmx_anaeig.c