From 2601e2fb7e5770a620dfa00abb939eab218ac38e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 12 Apr 2016 10:25:19 -0400 Subject: [PATCH] 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 --- src/rgw/rgw_rados.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2bcc7b64ced11..c02b153f28e78 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; -- 2.39.5