]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: avoid use-after-move in RGWDataSyncSingleEntryCR ctor 59319/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 1 Sep 2022 14:43:39 +0000 (10:43 -0400)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Mon, 19 Aug 2024 16:33:17 +0000 (23:33 +0700)
the constructor body below accesses the constructor's 'obligation'
parameter instead of the member variable it was moved into

Fixes: https://tracker.ceph.com/issues/57329
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit a4c2e6310d4fc41f99208c80525afe25412218c5)

src/rgw/rgw_data_sync.cc

index d50572653c3681a0a66a9fad126f3b7f7a2b6cad..5196a1db86593dadc38202ff96b888f395c2b7a5 100644 (file)
@@ -1280,13 +1280,13 @@ class RGWDataSyncSingleEntryCR : public RGWCoroutine {
   int sync_status = 0;
 public:
   RGWDataSyncSingleEntryCR(RGWDataSyncCtx *_sc, rgw::bucket_sync::Handle state,
-                           rgw_data_sync_obligation obligation,
+                           rgw_data_sync_obligation _obligation,
                            RGWDataSyncShardMarkerTrack *_marker_tracker,
                            const rgw_raw_obj& error_repo,
                            boost::intrusive_ptr<const RGWContinuousLeaseCR> lease_cr,
                            const RGWSyncTraceNodeRef& _tn_parent)
     : RGWCoroutine(_sc->cct), sc(_sc), sync_env(_sc->env),
-      state(std::move(state)), obligation(std::move(obligation)),
+      state(std::move(state)), obligation(std::move(_obligation)),
       marker_tracker(_marker_tracker), error_repo(error_repo),
       lease_cr(std::move(lease_cr)) {
     set_description() << "data sync single entry (source_zone=" << sc->source_zone << ") " << obligation;