Fixes potential bug in neighborsearching.
authorDavid van der Spoel <spoel@xray.bmc.uu.se>
Mon, 22 Sep 2014 11:05:20 +0000 (13:05 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 23 Sep 2014 13:49:59 +0000 (15:49 +0200)
commit3acec9446e43553cb549e0775a5f4e235c7b783c
tree1212e39eb33326c27ba8dbfa7e1081468f54dfc5
parent79cdf779e78f4f4c0c8573dc686004b9af94eb33
Fixes potential bug in neighborsearching.

From put_in_list we first call new_i_nblist, then add some
j particles and then close_i_nblist

In new_i_nblist the number of i particles is typically
increased by one, that is nblist->nri is increased.

However, in case that there are no j particles, the nri
is not decreased again, which can lead to reading garbage
data from e.g. nblist->jjindex. In addition there is a
left-over variable (len) that computes the number of
j particles added, but this value is not used.

Change-Id: I38601a6865f6a4d879bec55246deded40943afb7
src/gromacs/mdlib/ns.c