mgr/DaemonServer: avoid dereferencing end() iterator

Fixes: http://tracker.ceph.com/issues/23249
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2018-06-25 16:00:02 -05:00
parent d038e1da7a
commit 97ef5a8510

View File

@ -1237,8 +1237,7 @@ bool DaemonServer::handle_command(MCommand *m)
auto p = pg_map.osd_stat.find(osd);
if (p == pg_map.osd_stat.end()) {
missing_stats.insert(osd);
}
if (p->second.num_pgs > 0) {
} else if (p->second.num_pgs > 0) {
stored_pgs.insert(osd);
}
}