]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW - Don't move attrs before setting them 41761/head
authorDaniel Gryniewicz <dang@redhat.com>
Tue, 8 Jun 2021 16:59:56 +0000 (12:59 -0400)
committerDaniel Gryniewicz <dang@redhat.com>
Tue, 8 Jun 2021 16:59:56 +0000 (12:59 -0400)
Moving the attrs into s->bucket_attrs before setting them results in
setting empty attrs into the bucket.  This means that reading them back
later gets empty attrs, which can cause a segfault.

Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
src/rgw/rgw_op.cc

index ad1b0a82c9b2979de0d21991404bbf1fa3bb14b5..5c8a9b6cd566839c47dcc3a8a5ba2b948d869e6a 100644 (file)
@@ -7356,9 +7356,6 @@ void RGWSetAttrs::execute(optional_yield y)
     rgw::sal::Attrs a(attrs);
     op_ret = s->object->set_obj_attrs(this, s->obj_ctx, &a, nullptr, y);
   } else {
-    for (auto& iter : attrs) {
-      s->bucket_attrs[iter.first] = std::move(iter.second);
-    }
     op_ret = s->bucket->set_instance_attrs(this, attrs, y);
   }