]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDCache.cc: fix dereference after null check
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 29 May 2013 13:04:13 +0000 (15:04 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 31 May 2013 17:15:23 +0000 (19:15 +0200)
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>
src/mds/MDCache.cc

index f2114565573c3d7090bc798d6a84c0733158b570..f7d5ed5ed8cc8657d5b350479b4dfd8bb24896eb 100644 (file)
@@ -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);