]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: avoid use-after-move in RGWDataSyncSingleEntryCR ctor 47904/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 1 Sep 2022 14:43:39 +0000 (10:43 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 1 Sep 2022 14:44:58 +0000 (10:44 -0400)
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>
src/rgw/rgw_data_sync.cc

index ec76e153d95861344cda20deb2053dacab0135cd..4df4bf7687a1ca09413306ac3d8d542e0fb9f8da 100644 (file)
@@ -1308,13 +1308,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;