cmSystemTools: Early return if size makes later comparison false.

This commit is contained in:
Stephen Kelly 2015-01-27 23:50:42 +01:00
parent 11093a03e0
commit 803317aab6
1 changed files with 4 additions and 0 deletions

View File

@ -366,6 +366,10 @@ bool cmSystemTools::IsInternallyOn(const char* val)
return false;
}
std::basic_string<char> v = val;
if (v.size() > 4)
{
return false;
}
for(std::basic_string<char>::iterator c = v.begin();
c != v.end(); c++)