]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
fix:Add empty string check after url_decode
authorEmin <emin.sunacoglu@clyso.com>
Wed, 21 May 2025 12:53:45 +0000 (14:53 +0200)
committerEmin <emin.sunacoglu@clyso.com>
Tue, 27 May 2025 13:30:08 +0000 (15:30 +0200)
Signed-off-by: Emin <emin.sunacoglu@clyso.com>
src/rgw/rgw_op.cc

index 1ef57eda495953ed05de9e6ef6beb293f3e23fe7..e061bbc78c1c08873968e5e45a7a41a3d45bac21 100644 (file)
@@ -4001,6 +4001,12 @@ int RGWPutObj::init_processing(optional_yield y) {
       copy_source_object_name =
         url_decode(copy_source_object_name.substr(0, pos));
     }
+    if (copy_source_object_name.empty()) {
+      //means url_decode returned empty string so the url is formatted badly
+      ret = -EINVAL;
+      ldpp_dout(this, 5) << "x-amz-copy-source bad format" << dendl;
+      return ret;
+    }
     pos = copy_source_bucket_name.find(":");
     if (pos == std::string::npos) {
       // if tenant is not specified in x-amz-copy-source, use tenant of the requester