summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2015-01-02 09:46:08 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2015-01-02 09:46:08 (GMT)
commitf89e41c3e7c6d47dd26a47e3543ada2301db7521 (patch)
tree317ba97037b8ccb4712626fa789c6c255a60561d /Source/CPack/cmCPackGenerator.cxx
parentec31926d24ac2cf9a8aef4cfbcbeaaca0c99b717 (diff)
downloadCMake-f89e41c3e7c6d47dd26a47e3543ada2301db7521.zip
CMake-f89e41c3e7c6d47dd26a47e3543ada2301db7521.tar.gz
CMake-f89e41c3e7c6d47dd26a47e3543ada2301db7521.tar.bz2
CPack invalid CMake generator
Case where CPACK_CMAKE_GENERATOR value is non existent or or contains multiple words that were not quoted was not handled and produced a segmentation fault.
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index e78f161..2330278 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -628,6 +628,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmGlobalGenerator* globalGenerator
= this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
cmakeGenerator);
+ if ( !globalGenerator )
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Specified package generator not found. "
+ "CPACK_CMAKE_GENERATOR value is invalid."
+ << std::endl);
+ return 0;
+ }
// set the global flag for unix style paths on cmSystemTools as
// soon as the generator is set. This allows gmake to be used
// on windows.