浏览代码

Better error checking.

Berk Geveci 24 年之前
父节点
当前提交
44062bf4b7
共有 3 个文件被更改,包括 15 次插入0 次删除
  1. 5 0
      Source/cmVTKWrapJavaCommand.cxx
  2. 5 0
      Source/cmVTKWrapPythonCommand.cxx
  3. 5 0
      Source/cmVTKWrapTclCommand.cxx

+ 5 - 0
Source/cmVTKWrapJavaCommand.cxx

@@ -69,6 +69,11 @@ bool cmVTKWrapJavaCommand::InitialPass(std::vector<std::string>& args)
       j != args.end(); ++j)
     {   
     cmMakefile::SourceMap::iterator l = Classes.find(*j);
+    if (l == Classes.end())
+      {
+      this->SetError("bad source list passed to VTKWrapJavaCommand");
+      return false;
+      }
     for(std::vector<cmSourceFile>::iterator i = l->second.begin(); 
         i != l->second.end(); i++)
       {

+ 5 - 0
Source/cmVTKWrapPythonCommand.cxx

@@ -70,6 +70,11 @@ bool cmVTKWrapPythonCommand::InitialPass(std::vector<std::string>& args)
       j != args.end(); ++j)
     {   
     cmMakefile::SourceMap::iterator l = Classes.find(*j);
+    if (l == Classes.end())
+      {
+      this->SetError("bad source list passed to VTKWrapPythonCommand");
+      return false;
+      }
     for(std::vector<cmSourceFile>::iterator i = l->second.begin(); 
         i != l->second.end(); i++)
       {

+ 5 - 0
Source/cmVTKWrapTclCommand.cxx

@@ -101,6 +101,11 @@ bool cmVTKWrapTclCommand::InitialPass(std::vector<std::string>& args)
         j != sources.end(); ++j)
       {   
       cmMakefile::SourceMap::iterator l = Classes.find(*j);
+      if (l == Classes.end())
+	{
+	this->SetError("bad source list passed to VTKWrapTclCommand");
+	return false;
+	}
       for(std::vector<cmSourceFile>::iterator i = l->second.begin(); 
           i != l->second.end(); i++)
         {