From 6038511c70d0ed4f5eb75194c1bc071f10653136 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Thu, 1 Sep 2022 11:06:44 -0400 Subject: [PATCH] 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 --- src/rgw/rgw_rest_s3.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 7e1ae09b6324f..b342ffec318e9 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -614,8 +614,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) {