From: Casey Bodley Date: Thu, 1 Sep 2022 14:43:39 +0000 (-0400) Subject: rgw: avoid use-after-move in RGWDataSyncSingleEntryCR ctor X-Git-Tag: v18.0.0~104^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F47904%2Fhead;p=ceph.git rgw: avoid use-after-move in RGWDataSyncSingleEntryCR ctor 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 --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index ec76e153d958..4df4bf7687a1 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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 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;