summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-06-27 13:56:21 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-06-27 13:56:21 (GMT)
commit8033e3220315f3ef19bbcbedf127d99f31c318db (patch)
treef21ee5ca85b94ecaab18226d6eb2a714401a7daf /Source/cmFileCommand.cxx
parentf372c0f55220e10d3f9789916bfdd8a18de2d855 (diff)
downloadCMake-8033e3220315f3ef19bbcbedf127d99f31c318db.zip
CMake-8033e3220315f3ef19bbcbedf127d99f31c318db.tar.gz
CMake-8033e3220315f3ef19bbcbedf127d99f31c318db.tar.bz2
ENH: fix crash when glob has wrong number of arguments
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index b3bbb09..bbf4265 100644
--- a/Source/cmFileCommand.cxx
+++ b/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()) )
{