]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: add assert to snapset.clones search
authorSamuel Just <sam.just@inktank.com>
Tue, 25 Sep 2012 20:54:12 +0000 (13:54 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 25 Sep 2012 21:09:32 +0000 (14:09 -0700)
CID 716943: Using invalid iterator (INVALIDATE_ITERATOR)At (27): Dereferencing
iterator "p" though it is already past the end of its container.

The assert ensures that p will not be dereferenced if invalid.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index cfbfe2443823dc9b3089619430c498079284e4ed..537c7092e21d9a2e9b4038107c9d28014c077b53 100644 (file)
@@ -1348,6 +1348,7 @@ ReplicatedPG::RepGather *ReplicatedPG::trim_object(const hobject_t &coid,
     for (p = snapset.clones.begin(); p != snapset.clones.end(); p++)
       if (*p == last)
        break;
+    assert(p != snapset.clones.end());
     object_stat_sum_t delta;
     if (p != snapset.clones.begin()) {
       // not the oldest... merge overlap into next older clone