]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix bad iterator dereference reported by coverity 13272/head
authorJohn Spray <john.spray@redhat.com>
Mon, 6 Feb 2017 11:31:44 +0000 (11:31 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 7 Feb 2017 10:41:07 +0000 (10:41 +0000)
Fixes: http://tracker.ceph.com/issues/18830
Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/Locker.cc

index 95a1f24d08ce3426754447bd4fe72a0a6450d886..79da56f43b2f57c072aa2968ea3da6be58657fe2 100644 (file)
@@ -471,7 +471,7 @@ bool Locker::acquire_locks(MDRequestRef& mdr,
     }
     
     // hose any stray locks
-    if (*existing == *p) {
+    if (existing != mdr->locks.end() && *existing == *p) {
       assert(need_wrlock || need_remote_wrlock);
       SimpleLock *lock = *existing;
       if (mdr->wrlocks.count(lock)) {