]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: segment fault when shard id out of range
authorredickwang <redickwang@tencent.com>
Fri, 19 May 2017 07:08:12 +0000 (15:08 +0800)
committerredickwang <redickwang@tencent.com>
Fri, 19 May 2017 07:08:12 +0000 (15:08 +0800)
Fixes: http://tracker.ceph.com/issues/19732
Signed-off-by: redickwang <redickwang@tencent.com>
src/rgw/rgw_bucket.cc

index 8b2bc5f46df164cf37b578915a2b49891091dd22..d485ebbf958d7806cc973f8d393eeb8f43e5c5d0 100644 (file)
@@ -1730,6 +1730,8 @@ int RGWDataChangesLog::list_entries(int shard, const real_time& start_time, cons
                                    const string& marker,
                                    string *out_marker,
                                    bool *truncated) {
+  if (shard >= num_shards)
+    return -EINVAL;
 
   list<cls_log_entry> log_entries;