From 4d414927081c939b172452c6095c2cc958d5d1f8 Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 10 Apr 2017 13:00:41 +0100 Subject: [PATCH] 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 --- src/mon/MonClient.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 9e36ff032bc..684b3f617b5 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; -- 2.39.5