]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: swift : check for valid key in POST forms 52729/head
authorAbhishek Lekshmanan <abhishek.l@cern.ch>
Thu, 19 Jan 2023 08:46:10 +0000 (09:46 +0100)
committerAbhishek Lekshmanan <abhishek.l@cern.ch>
Tue, 1 Aug 2023 11:15:22 +0000 (13:15 +0200)
Avoid processing key based info if the POST form didn't contain a key

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
(cherry picked from commit 4be2fcee0dee934b7b698c559e12ef46a97e8cb0)
modified changes to be compatible with pacific's rgw_sal version

src/rgw/rgw_rest_swift.cc

index 657fa54ee2007590a0e72a8f5fe93c38f358bc79..3fda858d64cabb8bd9a5f91b7884b080194ffe80 100644 (file)
@@ -1982,8 +1982,10 @@ void RGWFormPost::init(rgw::sal::RGWRadosStore* const store,
                        req_state* const s,
                        RGWHandler* const dialect_handler)
 {
-  prefix = std::move(s->object->get_name());
-  s->object->set_key(rgw_obj_key());
+  if (s->object != nullptr && !s->object->empty()) {
+    prefix = std::move(s->object->get_name());
+    s->object->set_key(rgw_obj_key());
+  }
 
   return RGWPostObj_ObjStore::init(store, s, dialect_handler);
 }