diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 03a8b2fa117..e28bcf9bf36 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -28,7 +28,7 @@ atomic_t buffer_total_alloc; void buffer::list::encode_base64(buffer::list& o) { - bufferptr bp(length() * 4 / 3 + 1); + bufferptr bp(length() * 4 / 3 + 3); int l = ceph_armor(bp.c_str(), c_str(), c_str() + length()); bp.set_length(l); o.push_back(bp); @@ -36,7 +36,7 @@ void buffer::list::encode_base64(buffer::list& o) void buffer::list::decode_base64(buffer::list& e) { - bufferptr bp(e.length() * 3 / 4 + 1); + bufferptr bp(e.length() * 3 / 4 + 4); int l = ceph_unarmor(bp.c_str(), e.c_str(), e.c_str() + e.length()); assert(l <= (int)bp.length()); bp.set_length(l);