]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: avoid dereferencing end() iterator 22806/head
authorSage Weil <sage@redhat.com>
Mon, 25 Jun 2018 21:00:02 +0000 (16:00 -0500)
committerNathan Cutler <ncutler@suse.com>
Tue, 3 Jul 2018 07:01:48 +0000 (09:01 +0200)
Fixes: http://tracker.ceph.com/issues/23249
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 97ef5a85100d3166910fc401465950c59a6664f1)

src/mgr/DaemonServer.cc

index 29f380ca5a6b5d398ca6d613c27062a939f6a65e..29079b11c78921b02f532e9ec11e82fa8d7ad4bf 100644 (file)
@@ -1080,8 +1080,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);
                }
              }