in rgw_admin we're assigning a string from a bufferlist by explicitly
specifying a size and using assign, in this case the whole contents of
the buffer are copied regardless of whether the null character is seen.
Just use normal assign which would only copy until the null is
encountered
Fixes: http://tracker.ceph.com/issues/20037
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit
b38bda730dd9a0112024e9ecea95cd0d9c80d18f)
Conflicts:
src/rgw/rgw_rados.cc (trivial resolution)
{
string val;
if (bl.length() > 0) {
- val.assign(bl.c_str(), bl.length());
+ val.assign(bl.c_str());
}
f->dump_string(field_name, val);
bufferlist manifest_bl = s->attrset[RGW_ATTR_MANIFEST];
if (s->obj_tag.length())
- ldout(cct, 20) << "get_system_obj_state: setting s->obj_tag to " << string(s->obj_tag.c_str(), s->obj_tag.length()) << dendl;
+ ldout(cct, 20) << "get_system_obj_state: setting s->obj_tag to " << s->obj_tag.c_str() << dendl;
else
ldout(cct, 20) << "get_system_obj_state: s->obj_tag was set empty" << dendl;
}
}
if (s->obj_tag.length())
- ldout(cct, 20) << "get_obj_state: setting s->obj_tag to " << string(s->obj_tag.c_str(), s->obj_tag.length()) << dendl;
+ ldout(cct, 20) << "get_obj_state: setting s->obj_tag to " << s->obj_tag.c_str() << dendl;
else
ldout(cct, 20) << "get_obj_state: s->obj_tag was set empty" << dendl;