From: Yehuda Sadeh Date: Sat, 5 Jan 2019 18:24:34 +0000 (-0800) Subject: rgw: fix generic obj attrs to http headers X-Git-Tag: v14.1.0~314^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4a5aac7d0c70ce3a2bf79fec1e5321b8f7fb365;p=ceph.git rgw: fix generic obj attrs to http headers use bl.to_str() instead of bl.c_str() to avoid encoding of the null termination. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 2f87e9e64496..2f4c53282039 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -290,7 +290,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs, if (aiter != rgw_to_http_attrs.end()) { if (response_attrs.count(aiter->second) == 0) { /* Was not already overridden by a response param. */ - response_attrs[aiter->second] = iter->second.c_str(); + response_attrs[aiter->second] = iter->second.to_str(); } } else if (iter->first.compare(RGW_ATTR_CONTENT_TYPE) == 0) { /* Special handling for content_type. */