From 7fae941299e0c3ffc7a3016d94579d21c80d8956 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 16 Jun 2014 11:48:24 -0700 Subject: [PATCH] rgw: allocate enough space for bucket instance id Fixes: #8608 Backport: dumpling, firefly Bucket instance id is a concatenation of zone name, rados instance id, and a running counter. We need to allocate enough space to account zone name length. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rados.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index bef9718c1236a..3fdb49209baea 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -2381,7 +2381,7 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket, if (!pmaster_bucket) { uint64_t iid = instance_id(); uint64_t bid = next_bucket_id(); - char buf[32]; + char buf[zone.name.size() + 48]; snprintf(buf, sizeof(buf), "%s.%llu.%llu", zone.name.c_str(), (long long)iid, (long long)bid); bucket.marker = buf; bucket.bucket_id = bucket.marker; -- 2.39.5