]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fix bug where variable referenced after data moved out
authorJ. Eric Ivancich <ivancich@redhat.com>
Thu, 1 Sep 2022 15:06:44 +0000 (11:06 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Thu, 1 Sep 2022 15:06:44 +0000 (11:06 -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>
src/rgw/rgw_rest_s3.cc

index 7e1ae09b6324f1e3924c0a81858398cf05335f31..b342ffec318e993962aec2294ee61b92a6a6f6c0 100644 (file)
@@ -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) {