Browse Source

cmSystemTools: Early return if size makes later comparison false.

Stephen Kelly 10 years ago
parent
commit
803317aab6
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Source/cmSystemTools.cxx

+ 4 - 0
Source/cmSystemTools.cxx

@@ -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++)