Skip to content
Snippets Groups Projects
Commit c494c58b authored by Markus Blatt's avatar Markus Blatt
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.
parent 9588afdf
No related branches found
No related tags found
No related merge requests found
......@@ -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.
Finish editing this message first!
Please register or to comment