]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: avoid dereferencing end() iterator 22805/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:12 +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 421c87d8a6f457a3fcaf504804635befe6375d5f..437972eb46a1a6149108111949136c782a03c981 100644 (file)
@@ -1224,8 +1224,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);
                }
              }