Project

General

Profile

Bug #404

MiceModule sets iterator to iterator.end() instead of break

Added by Tunnell, Christopher almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Tunnell, Christopher
Category:
common_cpp
Target version:
Start date:
30 March 2011
Due date:
% Done:

100%

Estimated time:
Workflow:

Description

See below:

void MiceModule::ithHep3Vector( int i, std::string& name, Hep3Vector& val ) const
859{
860 int count = 0;
861
Incrementing iterator "it" though it is already past the end of its container.
862 for( std::map<std::string,std::string>::const_iterator it = _hep3vectors.begin(); it != _hep3vectors.end(); ++it )
863 {
864 if( count == i )
865 {
866 name = it->first;
867 val = propertyHep3Vector(name);
Assigning: "it" = "this->_hep3vectors.end()".
Function "end" creates an iterator.
868 it = _hep3vectors.end();
869 }
870 ++count;
871 }
872}

The fix is to change the about 5 cases of this happening in MiceModule.cc from it = blah.end() to break. This is a coverity bug.

#1

Updated by Tunnell, Christopher almost 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r406.

Also available in: Atom PDF