Explorar el Código

cmSystemTools: Early return if size makes later comparison false.

Stephen Kelly hace 10 años
padre
commit
803317aab6
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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++)