From 3bae343f62e050da78476811234e1f8a055f5d04 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 25 Jun 2014 09:13:53 -0400 Subject: cmCPackGenerator: Avoid crash on undefined CMAKE_MAKE_PROGRAM Since commit 6557382d (stringapi: Use strings for program paths, 2014-02-24), cmGlobalGenerator::GenerateBuildCommand takes the make program path as a std::string. Fix the lookup in cmCPackGenerator::InstallProjectViaInstallCMakeProjects to use GetSafeDefinition for CMAKE_MAKE_PROGRAM to avoid possible construction of std::string from a NULL. Reported-by: Richard Wirth --- Source/CPack/cmCPackGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 91f92c5..9336bed 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -637,8 +637,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( if ( globalGenerator->GetPreinstallTargetName() ) { globalGenerator->FindMakeProgram(this->MakefileMap); - const char* cmakeMakeProgram - = this->MakefileMap->GetDefinition("CMAKE_MAKE_PROGRAM"); + std::string cmakeMakeProgram + = this->MakefileMap->GetSafeDefinition("CMAKE_MAKE_PROGRAM"); std::vector buildCommand; globalGenerator->GenerateBuildCommand(buildCommand, cmakeMakeProgram, installProjectName, installDirectory, -- cgit v0.12