summaryrefslogtreecommitdiffstats
path: root/Source/cmServerProtocol.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-03 13:34:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-08-03 13:34:15 (GMT)
commitee79d7a130465bce19864399a9adde4e79c6fd5c (patch)
tree5fa0e191aa035bb841bd057b16e56714f8768bc7 /Source/cmServerProtocol.cxx
parent973ee6605bcbe9db18fd66032d6fc6654341ad84 (diff)
parent70272f3c369f74c64bb0a535f5a6eb15253685a4 (diff)
downloadCMake-ee79d7a130465bce19864399a9adde4e79c6fd5c.zip
CMake-ee79d7a130465bce19864399a9adde4e79c6fd5c.tar.gz
CMake-ee79d7a130465bce19864399a9adde4e79c6fd5c.tar.bz2
Merge topic 'server-fix-crash'
70272f3c server: Fix crash on missing cache entries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1096
Diffstat (limited to 'Source/cmServerProtocol.cxx')
-rw-r--r--Source/cmServerProtocol.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 8ad4916..7a841a8 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -289,7 +289,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 " +