Skip to content
Snippets Groups Projects
Commit f520fbc6 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

<0 divide-by-zero issue, 1075939, re #13918

parent 7ab2b5ec
No related branches found
No related tags found
No related merge requests found
......@@ -1554,6 +1554,13 @@ void InstrumentDefinitionParser::populateIdList(Poco::XML::Element *pE,
increment = atoi((pIDElem->getAttribute("step")).c_str());
// check the start end and increment values are sensible
if (increment <= 0) {
std::stringstream ss;
ss << "The step element must be strictly positive, found step: "
<< increment;
throw Kernel::Exception::InstrumentDefinitionError(ss.str(),
filename);
}
if (((endID - startID) / increment) < 0) {
std::stringstream ss;
ss << "The start, end, and step elements do not allow a single id "
......
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