From: Sage Weil Date: Tue, 12 Apr 2016 14:25:19 +0000 (-0400) Subject: rgw/rgw_rados: use to_str() instead of c_str() X-Git-Tag: ses3-milestone4~31^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8559%2Fhead;p=ceph.git rgw/rgw_rados: use to_str() instead of c_str() bufferlist::c_str() doesn't guarantee null termination. Fixes: http://tracker.ceph.com/issues/15463 Signed-off-by: Sage Weil --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2bcc7b64ced1..c02b153f28e7 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -7130,7 +7130,7 @@ int RGWRados::Object::complete_atomic_modification() cls_rgw_obj_chain chain; store->update_gc_chain(obj, state->manifest, &chain); - string tag = (state->obj_tag.c_str() ? state->obj_tag.c_str() : ""); + string tag = state->obj_tag.to_str(); int ret = store->gc->send_chain(chain, tag, false); // do it async return ret;