From 183d261b116decd6ab09a7d1a522a9ad4add47b4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 30 Nov 2010 08:39:16 -0500 Subject: [PATCH] Fix find_* argument parsing crash (#11513) Previously the command find_path(VAR DOC "") would crash because the argument pre-processing removed the DOC "" arguments but the rest of the parsing assumes at least 2 arguments. Reject the call with an error instead. --- Source/cmFindBase.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 041653896..d0fe99f24 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -164,6 +164,11 @@ bool cmFindBase::ParseArguments(std::vector const& argsIn) } } } + if(args.size() < 2 ) + { + this->SetError("called with incorrect number of arguments"); + return false; + } this->VariableName = args[0]; if(this->CheckForVariableInCache()) {