Commit 9aadfc9f authored by Dean Inglis's avatar Dean Inglis
Browse files

fix bug in MedicalImageProperties

An iterator returned from a container .find(...)
was being dereferenced without checking for a
returned end of container failure case.  The
fix checks for end of container condition before
derefencing the iterator.

Change-Id: Iccc5a31629d09a143e3712ba9c936528ef868afc
parent efc0fd92
...@@ -74,8 +74,11 @@ public: ...@@ -74,8 +74,11 @@ public:
{ {
UserDefinedValue key(name); UserDefinedValue key(name);
UserDefinedValues::const_iterator it = UserDefinedValuePool.find( key ); UserDefinedValues::const_iterator it = UserDefinedValuePool.find( key );
assert( strcmp(it->Name.c_str(), name) == 0 ); if( it != UserDefinedValuePool.end() )
return it->Value.c_str(); {
assert( strcmp(it->Name.c_str(), name) == 0 );
return it->Value.c_str();
}
} }
return NULL; return NULL;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment