From: VRan Liu Date: Mon, 24 Nov 2014 02:35:41 +0000 (+0800) Subject: check endpoints is not empty before use it. X-Git-Tag: v0.90~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8b195eccadbd4d48518e33e08670b25527c3ca23;p=ceph.git check endpoints is not empty before use it. Signed-off-by: VRan Liu (cherry picked from commit 9d5e4edc15678de675d7a77badcbace0b710d553) --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 04de5a2954ebb..4100d408675dd 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -373,7 +373,7 @@ static int rgw_build_policies(RGWRados *store, struct req_state *s, bool only_bu string& region = s->bucket_info.region; map::iterator dest_region = store->region_map.regions.find(region); - if (dest_region != store->region_map.regions.end()) { + if (dest_region != store->region_map.regions.end() && !dest_region->second.endpoints.empty()) { s->region_endpoint = dest_region->second.endpoints.front(); } if (s->bucket_exists && !store->region.equals(region)) {