From a4c2e6310d4fc41f99208c80525afe25412218c5 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 1 Sep 2022 10:43:39 -0400 Subject: [PATCH] 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 --- src/rgw/rgw_data_sync.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index ec76e153d9586..4df4bf7687a1c 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; -- 2.39.5