From: Danny Al-Gaaf Date: Wed, 29 May 2013 13:04:13 +0000 (+0200) Subject: mds/MDCache.cc: fix dereference after null check X-Git-Tag: v0.65~168^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=38ee69c2f53c412829f656813ef6b5219e8b055e;p=ceph.git mds/MDCache.cc: fix dereference after null check Add assert for 'parent' before call assert on parent->is_auth(). CID 716922 (#1 of 1): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null pointer "parent" to function "MDSCacheObject::is_auth() const", which dereferences it. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index f2114565573c..f7d5ed5ed8cc 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -2126,6 +2126,7 @@ void MDCache::predirty_journal_parents(Mutation *mut, EMetaBlob *blob, } // now, stick it in the blob + assert(parent); assert(parent->is_auth()); blob->add_dir_context(parent); blob->add_dir(parent, true);