Fix memory access issues in gmx solvate
authorTeemu Murtola <teemu.murtola@gmail.com>
Tue, 28 Mar 2017 17:16:38 +0000 (20:16 +0300)
committerAleksei Iupinov <a.yupinov@gmail.com>
Thu, 6 Apr 2017 13:08:38 +0000 (15:08 +0200)
commit8ea59db7b4c9633dd6fdae849e556e5564641249
tree80a7cc65ad946369da868689c2ec0537a48da3c9
parentfb11d6cb7892a20e1e324efc4ea12cc43e73fa95
Fix memory access issues in gmx solvate

There were out-of-bounds access if
 1) the solvent configuration was given as a .pdb file, or
 2) there were more than one type of residue in the solvent (which
    triggered sorting).

Also fix a memory leak in the sorting routine.

Should fix crashes mentioned in #2148.

Change-Id: If08a7bea989803dc5641f53478004e830268750d
src/gromacs/gmxpreprocess/solvate.cpp