]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix bug where variable referenced after data moved out 48228/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Thu, 1 Sep 2022 15:06:44 +0000 (11:06 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Fri, 23 Sep 2022 17:41:42 +0000 (13:41 -0400)
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 <ivancich@redhat.com>
(cherry picked from commit 6038511c70d0ed4f5eb75194c1bc071f10653136)

src/rgw/rgw_rest_s3.cc

index 7d6a51a573d79e1391b00fb89910757a912e9d4e..9b5128d084500d1cad29a8bac3ebb4a210fb620f 100644 (file)
@@ -617,8 +617,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) {