Merge pull request #38905 from cbodley/wip-48874

rgw: fix trailing null in object names of multipart reuploads
This commit is contained in:
Harish Munjulur 2021-01-25 15:17:05 -08:00 committed by GitHub
commit d358f62397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -336,8 +336,7 @@ int MultipartObjectProcessor::process_first_chunk(bufferlist&& data,
int r = writer.write_exclusive(data);
if (r == -EEXIST) {
// randomize the oid prefix and reprepare the head/manifest
std::string oid_rand(32, 0);
gen_rand_alphanumeric(store->ctx(), oid_rand.data(), oid_rand.size());
std::string oid_rand = gen_rand_alphanumeric(store->ctx(), 32);
mp.init(target_obj->get_name(), upload_id, oid_rand);
manifest.set_prefix(target_obj->get_name() + "." + oid_rand);