Skip to content
Snippets Groups Projects
Commit 882f5b6d authored by Markus Blatt's avatar Markus Blatt Committed by Carsten Gräser
Browse files

[release,bugfix] Prevent index out of bounds in parametertreetest.


by testing whether we work on a end iterator. In this case the distance
function will fail. Found that out by gcc's stdlib with debugging turned on.

(cherry picked from commit c494c58b)
Signed-off-by: default avatarCarsten Gräser <graeser@dune-project.org>
parent 64e814b1
Branches
Tags
1 merge request!2512017-05 merge of upstream repository
......@@ -189,7 +189,8 @@ void Dune::ParameterTreeParser::readNamedOptions(int argc, char* argv[],
DUNE_THROW(ParameterTreeParserError,
"parameter " << key << " already specified" << "\n" << helpstr);
pt[key] = value;
done[std::distance(keywords.begin(),it)] = true; // mark key as stored
if(it != keywords.end())
done[std::distance(keywords.begin(),it)] = true; // mark key as stored
}
else {
// map to the next keyword in the list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment