Fix possible memory error with long selections
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 3 Dec 2016 08:50:56 +0000 (10:50 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 8 Dec 2016 16:21:56 +0000 (17:21 +0100)
commitb7817e2da7e2e4df1292e7bc3f4f5414a1a77999
tree225edac2e3b529d4398afd2f21ff173f30c4c9d9
parentc848f4a4b18eed9cd36d97a59d5d97f0cdd5ad4e
Fix possible memory error with long selections

If a selection was more than 1000 characters long and there was a
whitespace exactly at the 1000 point, a buffer overflow could occur.
Replaced the buffer with std::string, simplifying the code
significantly.  Update the generated code to use a newer flex, which
also removes the need for some suppressions.

Should fix #2086.

Change-Id: I56513bcf5ee99f05ce144461740d0f868be10186
src/gromacs/CMakeLists.txt
src/gromacs/selection/scanner.cpp
src/gromacs/selection/scanner.l
src/gromacs/selection/scanner.patch
src/gromacs/selection/scanner_flex.h
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/scanner_internal.h