From 38ee69c2f53c412829f656813ef6b5219e8b055e Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 29 May 2013 15:04:13 +0200 Subject: [PATCH] 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 --- src/mds/MDCache.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index f2114565573..f7d5ed5ed8c 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); -- 2.47.3