]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth:rectify a cmake compilation warning 53478/head
authorcuiming_yewu <cuiming_yewu@cmss.chinamobile.com>
Fri, 15 Sep 2023 06:14:39 +0000 (14:14 +0800)
committercuiming_yewu <cuiming_yewu@cmss.chinamobile.com>
Mon, 18 Sep 2023 07:30:06 +0000 (15:30 +0800)
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 <cuiming_yewu@cmss.chinamobile.com>
src/auth/cephx/CephxProtocol.cc

index 87a8b86b99b06d271d5bba3b2d90e7478624c692..9d423b1463d869efb8cb6a655205cba43045c631 100644 (file)
@@ -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): "