summaryrefslogtreecommitdiffstats
path: root/Source/cmConnection.cxx
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2017-07-21 03:18:41 (GMT)
committerBrad King <brad.king@kitware.com>2017-08-31 19:35:46 (GMT)
commit124424e9974ade26521bf4751f3701c1e7d91c3d (patch)
tree7ba1f93ae1fe351cd5fd04fbeb9ca30e94c78dee /Source/cmConnection.cxx
parent693fa0a96e111270337eb76a4da1255774657e1a (diff)
downloadCMake-124424e9974ade26521bf4751f3701c1e7d91c3d.zip
CMake-124424e9974ade26521bf4751f3701c1e7d91c3d.tar.gz
CMake-124424e9974ade26521bf4751f3701c1e7d91c3d.tar.bz2
server: Protect several fields from potentially pointing to bad memory
Diffstat (limited to 'Source/cmConnection.cxx')
-rw-r--r--Source/cmConnection.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmConnection.cxx b/Source/cmConnection.cxx
index 89013dc..c0d1b82 100644
--- a/Source/cmConnection.cxx
+++ b/Source/cmConnection.cxx
@@ -118,7 +118,9 @@ void cmEventBasedConnection::OnDisconnect(int onerror)
{
(void)onerror;
this->OnConnectionShuttingDown();
- this->Server->OnDisconnect(this);
+ if (this->Server) {
+ this->Server->OnDisconnect(this);
+ }
}
cmConnection::~cmConnection()
@@ -127,6 +129,7 @@ cmConnection::~cmConnection()
bool cmConnection::OnConnectionShuttingDown()
{
+ this->Server = nullptr;
return true;
}