summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-02 20:15:28 (GMT)
committerBrad King <brad.king@kitware.com>2017-08-02 20:27:06 (GMT)
commita7e4d595f9cd4d6c6da66f06e8ba11075ec579f3 (patch)
treeda0781ad9d2a2b0b309475cc7df1514f16ab4310
parent1181ad61d2f5a548d6a823a7fa4bff3a71fa7b3d (diff)
parent70272f3c369f74c64bb0a535f5a6eb15253685a4 (diff)
downloadCMake-a7e4d595f9cd4d6c6da66f06e8ba11075ec579f3.zip
CMake-a7e4d595f9cd4d6c6da66f06e8ba11075ec579f3.tar.gz
CMake-a7e4d595f9cd4d6c6da66f06e8ba11075ec579f3.tar.bz2
Merge branch 'server-fix-crash' into release-3.9
Merge-request: !1096
-rw-r--r--Source/cmServerProtocol.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index defba77..c5b7f60 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -284,7 +284,9 @@ static bool testValue(cmState* state, const std::string& key,
std::string& value, const std::string& keyDescription,
std::string* errorMessage)
{
- const std::string cachedValue = std::string(state->GetCacheEntryValue(key));
+ const char* entry = state->GetCacheEntryValue(key);
+ const std::string cachedValue =
+ entry == nullptr ? std::string() : std::string(entry);
if (!cachedValue.empty() && !value.empty() && cachedValue != value) {
setErrorMessage(errorMessage, std::string("\"") + key +
"\" is set but incompatible with configured " +