From fb222a0a1c98a4141b6d0e79eac7a41c208f7147 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 14 May 2013 19:07:29 +0200 Subject: [PATCH] mds/Server.cc: fix possible NULL pointer dereference Assert of straydn is NULL here. CID 1019558 (#1 of 1): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null pointer "straydn" to function "CDentry::get_dir() const", which dereferences it. Signed-off-by: Danny Al-Gaaf --- src/mds/Server.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 3e89156cd93d5..46adf2200213c 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -7100,6 +7100,7 @@ void Server::_rename_rollback_finish(Mutation *mut, MDRequest *mdr, CDentry *src if (destdn) { CInode *oldin = destdn->get_linkage()->get_inode(); // update subtree map? + assert(straydn); if (oldin && oldin->is_dir()) mdcache->adjust_subtree_after_rename(oldin, straydn->get_dir(), true); } -- 2.39.5