From 800c148d2e2991ff986d2c3e570c15ee7bf0d989 Mon Sep 17 00:00:00 2001 From: cuiming_yewu Date: Fri, 15 Sep 2023 14:14:39 +0800 Subject: [PATCH] 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 --- src/auth/cephx/CephxProtocol.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): " -- 2.39.5