From 8033e3220315f3ef19bbcbedf127d99f31c318db Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 27 Jun 2006 09:56:21 -0400 Subject: [PATCH] ENH: fix crash when glob has wrong number of arguments --- Source/cmFileCommand.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index b3bbb09d24..bbf42658f0 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -233,6 +233,11 @@ bool cmFileCommand::HandleGlobCommand(std::vector 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()) ) {