From: Yehuda Sadeh Date: Wed, 10 Oct 2018 00:22:25 +0000 (-0700) Subject: rgw: use bl.to_str() and not bl.c_str() X-Git-Tag: v14.1.0~314^2~51 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=63591be687577bcd5987d2ecfd3540e511d0881f;p=ceph.git rgw: use bl.to_str() and not bl.c_str() can't rely on bufferlist to be null terminated Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 6a1a5ed8bb69..0f7646511d5a 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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; }