]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
check endpoints is not empty before use it. 2985/head
authorVRan Liu <gliuwr@gmail.com>
Mon, 24 Nov 2014 02:35:41 +0000 (10:35 +0800)
committerVRan Liu <gliuwr@gmail.com>
Mon, 24 Nov 2014 02:35:41 +0000 (10:35 +0800)
Signed-off-by: VRan Liu <gliuwr@gmail.com>
src/rgw/rgw_op.cc

index 04de5a2954ebb1950e2eb0f9a678c61a7bd7012c..4100d408675dd0edfd08c16b79dd2784b62071cd 100644 (file)
@@ -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<string, RGWRegion>::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)) {