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: v17.2.8~122^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F59319%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 (cherry picked from commit a4c2e6310d4fc41f99208c80525afe25412218c5) --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index d50572653c3..5196a1db865 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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 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;