]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: abort early when s->length empty during putobj
authorJiaying Ren <jiaying.ren@umcloud.com>
Wed, 14 Jun 2017 08:15:53 +0000 (16:15 +0800)
committerJiaying Ren <jiaying.ren@umcloud.com>
Wed, 14 Jun 2017 08:15:53 +0000 (16:15 +0800)
Signed-off-by: Jiaying Ren <jiaying.ren@umcloud.com>
src/rgw/rgw_rest_s3.cc

index 0b2550d704b2e0c0c8806af03b93c0ef6d395e89..a3964552baa2ed9200fa04d26830431c05378817 100644 (file)
@@ -1104,15 +1104,15 @@ void RGWDeleteBucket_ObjStore_S3::send_response()
 
 int RGWPutObj_ObjStore_S3::get_params()
 {
+  if (!s->length)
+    return -ERR_LENGTH_REQUIRED;
+
   RGWObjectCtx& obj_ctx = *static_cast<RGWObjectCtx *>(s->obj_ctx);
   map<string, bufferlist> src_attrs;
   size_t pos;
   int ret;
 
   RGWAccessControlPolicy_S3 s3policy(s->cct);
-  if (!s->length)
-    return -ERR_LENGTH_REQUIRED;
-
   ret = create_s3_policy(s, store, s3policy, s->owner);
   if (ret < 0)
     return ret;