]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: avoid segfault in wait_auth_rotating
authorJohn Spray <john.spray@redhat.com>
Mon, 10 Apr 2017 12:00:41 +0000 (13:00 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 10 Apr 2017 12:02:00 +0000 (13:02 +0100)
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 <john.spray@redhat.com>
src/mon/MonClient.cc

index 9e36ff032bc5faf8ae84aa542b01d2c65b14a038..684b3f617b568cd9e0bc921411fa3e928be064d9 100644 (file)
@@ -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;