From: cuiming_yewu Date: Fri, 15 Sep 2023 06:14:39 +0000 (+0800) Subject: auth:rectify a cmake compilation warning X-Git-Tag: v19.0.0~471^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=800c148d2e2991ff986d2c3e570c15ee7bf0d989;p=ceph.git auth:rectify a cmake compilation warning rectify src/auth/cephx/CephxProtocol.cc 1 warning with the variable 'ch' Used before initialized auth/cephx/CephxProtocol.cc:595:57: warning: '*((void*)& ch +8)' may be used uninitialized in this function [-Wmaybe-uninitialized] msg.server_challenge_plus_one = ch.server_challenge + 1; ~~~~~~~~~~~~~~~~~~~~^~~ Signed-off-by: cuiming --- diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index 87a8b86b99b06..9d423b1463d86 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -584,7 +584,7 @@ bool CephXAuthorizer::add_challenge(CephContext *cct, auto p = challenge.begin(); if (!p.end()) { std::string error; - CephXAuthorizeChallenge ch; + CephXAuthorizeChallenge ch{}; decode_decrypt_enc_bl(cct, ch, session_key, challenge, error); if (!error.empty()) { ldout(cct, 0) << "failed to decrypt challenge (" << challenge.length() << " bytes): "