mirror of
https://github.com/ceph/ceph
synced 2025-01-19 09:32:00 +00:00
buffer: fix padding distances
This commit is contained in:
parent
c196851bd7
commit
76fb75e988
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user