]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use bl.to_str() and not bl.c_str()
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 10 Oct 2018 00:22:25 +0000 (17:22 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 4 Jan 2019 03:00:20 +0000 (19:00 -0800)
can't rely on bufferlist to be null terminated

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index 6a1a5ed8bb6982c9ab49640a367377ff7ffb58e5..0f7646511d5a7f93cdab898b1dc5d74d7db577ea 100644 (file)
@@ -3622,7 +3622,7 @@ int RGWRados::Object::Write::_do_write_meta(uint64_t size, uint64_t accounted_si
     if (name.compare(RGW_ATTR_ETAG) == 0) {
       etag = bl.to_str();
     } else if (name.compare(RGW_ATTR_CONTENT_TYPE) == 0) {
-      content_type = bl.c_str();
+      content_type = bl.to_str();
     } else if (name.compare(RGW_ATTR_ACL) == 0) {
       acl_bl = bl;
     }