Răsfoiți Sursa

ENH: fix crash when glob has wrong number of arguments

Bill Hoffman 19 ani în urmă
părinte
comite
8033e32203
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 5 0
      Source/cmFileCommand.cxx

+ 5 - 0
Source/cmFileCommand.cxx

@@ -233,6 +233,11 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
         }
       g.SetRelative(i->c_str());
       ++i;
+      if(i == args.end())
+        {
+        this->SetError("GLOB requires a glob expression after the directory");
+        return false;
+        }
       }
     if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) )
       {