From: J. Eric Ivancich Date: Thu, 1 Sep 2022 15:06:44 +0000 (-0400) Subject: rgw: fix bug where variable referenced after data moved out X-Git-Tag: v16.2.11~257^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F48229%2Fhead;p=ceph.git rgw: fix bug where variable referenced after data moved out Addresses RGWGetObj_ObjStore_S3::override_range_hdr using a variable for logging after the data had been moved out. This was caught by coverity. Signed-off-by: J. Eric Ivancich (cherry picked from commit 6038511c70d0ed4f5eb75194c1bc071f10653136) --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 8945e929fcb0..52eac0d97046 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -490,8 +490,8 @@ int RGWGetObj_ObjStore_S3::override_range_hdr(const rgw::auth::StrategyRegistry& std::string key = "HTTP_"; key.append(*k); boost::replace_all(key, "-", "_"); + ldpp_dout(this, 10) << "after splitting cache kv key: " << key << " " << *v << dendl; rgw_env->set(std::move(key), std::string(*v)); - ldpp_dout(this, 10) << "after splitting cache kv key: " << key << " " << rgw_env->get(key.c_str()) << dendl; } ret = RGWOp::verify_requester(auth_registry, y); if(!ret && backup_range) {