]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDCache.cc: fix possible NULL pointer dereference
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 15 May 2013 16:14:06 +0000 (18:14 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 22 May 2013 13:38:26 +0000 (15:38 +0200)
Assert if 'cur' is NULL.

CID 966616 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "cur" when
  calling "CInode::is_dir()".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mds/MDCache.cc

index cc661f214860a6366d07c7b959bd5138dc3ca37f..f4dc3ff8d053d05821b267fc2b647b5607c450cd 100644 (file)
@@ -9490,6 +9490,7 @@ void MDCache::handle_discover_reply(MDiscoverReply *m)
 
   // discover ino error
   if (p.end() && m->is_flag_error_ino()) {
+    assert(cur);
     assert(cur->is_dir());
     CDir *dir = cur->get_dirfrag(m->get_base_dir_frag());
     if (dir) {