summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-29 15:04:13 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-31 19:15:23 +0200
commit38ee69c2f53c412829f656813ef6b5219e8b055e (patch)
treec51b2ebe65a0fdd50628c33002a8e38ffb8d7383
parent5d8440e3713dbb0e8515a4a8527f97d7b84859a0 (diff)
downloadceph-38ee69c2f53c412829f656813ef6b5219e8b055e.tar.gz
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 <danny.al-gaaf@bisect.de>
-rw-r--r--src/mds/MDCache.cc1
1 files changed, 1 insertions, 0 deletions
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);