From e3edb83c51c531670bef8850a0504de56d47c7a9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 29 Jul 2004 11:45:14 -0400 Subject: BUG: Fixed crash when optimized/debug argument is not followed by a value. --- Source/cmLinkLibrariesCommand.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Source/cmLinkLibrariesCommand.cxx') diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx index 56d4937167..c34cd3c776 100644 --- a/Source/cmLinkLibrariesCommand.cxx +++ b/Source/cmLinkLibrariesCommand.cxx @@ -31,12 +31,22 @@ bool cmLinkLibrariesCommand::InitialPass(std::vector const& args) if (*i == "debug") { ++i; + if(i == args.end()) + { + this->SetError("The \"debug\" argument must be followed by a library"); + return false; + } m_Makefile->AddLinkLibrary(i->c_str(), cmTarget::DEBUG); } else if (*i == "optimized") { ++i; + if(i == args.end()) + { + this->SetError("The \"optimized\" argument must be followed by a library"); + return false; + } m_Makefile->AddLinkLibrary(i->c_str(), cmTarget::OPTIMIZED); } -- cgit v1.2.1