From: John Spray Date: Mon, 10 Apr 2017 12:00:41 +0000 (+0100) Subject: mon: avoid segfault in wait_auth_rotating X-Git-Tag: v12.0.2~132^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14430%2Fhead;p=ceph.git mon: avoid segfault in wait_auth_rotating MonClient users should not be calling into MonClient after calling shutdown(). However, MonClient should assert out rather than proceeding to try and follow a maybe-null pointer. Related to http://tracker.ceph.com/issues/19566 Signed-off-by: John Spray --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 9e36ff032bc5..684b3f617b56 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -899,6 +899,9 @@ int MonClient::wait_auth_rotating(double timeout) utime_t until = now; until += timeout; + // Must be initialized + assert(auth != nullptr); + if (auth->get_protocol() == CEPH_AUTH_NONE) return 0;