Skip to content

Commit

Permalink
Objecter: potential null pointer access when do pool_snap_list.
Browse files Browse the repository at this point in the history
Objecter: potential null pointer access when do pool_snap_list. Shall check pool existence first.
Fixes: #13639
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 8655416)
  • Loading branch information
xiexingguo authored and smithfarm committed Dec 7, 2015
1 parent d064636 commit 5d0b5c1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/osdc/Objecter.cc
Expand Up @@ -1281,6 +1281,8 @@ int Objecter::pool_snap_list(int64_t poolid, vector<uint64_t> *snaps)
RWLock::RLocker rl(rwlock);

const pg_pool_t *pi = osdmap->get_pg_pool(poolid);
if (!pi)
return -ENOENT;
for (map<snapid_t,pool_snap_info_t>::const_iterator p = pi->snaps.begin();
p != pi->snaps.end();
++p) {
Expand Down

0 comments on commit 5d0b5c1

Please sign in to comment.