From: Yehuda Sadeh Date: Wed, 18 Sep 2013 17:37:21 +0000 (-0700) Subject: rgw: use bufferlist::append() instead of bufferlist::push_back() X-Git-Tag: v0.67.4~27 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=babeb00c42af760b3e7575166479e95365cfcc0a;p=ceph.git rgw: use bufferlist::append() instead of bufferlist::push_back() push_back() expects char *, whereas append can append a single char. Appending a NULL char to push_back is cast as a NULL pointer which is bad. Signed-off-by: Yehuda Sadeh Reviewed-by: Josh Durgin (cherry picked from commit 08fe028bad13096d482454a2f303158727c363ff) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index bada7d22d1b6..5ec61b965a12 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -2616,7 +2616,7 @@ int RGWRados::copy_obj(void *ctx, { /* opening scope so that we can do goto, sorry */ bufferlist& extra_data_bl = processor.get_extra_data(); if (extra_data_bl.length()) { - extra_data_bl.push_back((char)0); + extra_data_bl.append((char)0); JSONParser jp; if (!jp.parse(extra_data_bl.c_str(), extra_data_bl.length())) { ldout(cct, 0) << "failed to parse response extra data. len=" << extra_data_bl.length() << " data=" << extra_data_bl.c_str() << dendl;