]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use bufferlist::append() instead of bufferlist::push_back()
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 18 Sep 2013 17:37:21 +0000 (10:37 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Thu, 19 Sep 2013 20:07:42 +0000 (13:07 -0700)
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 <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 08fe028bad13096d482454a2f303158727c363ff)

src/rgw/rgw_rados.cc

index bada7d22d1b6929d4cfec0e7676e086fa493a646..5ec61b965a12903e16e53f9b81b3ee870b4c1a9c 100644 (file)
@@ -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;