]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MDCache::handle_discover: fix null pointer deref
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sat, 1 Mar 2014 11:10:56 +0000 (12:10 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sat, 1 Mar 2014 11:10:56 +0000 (12:10 +0100)
CID 716990 (#1 of 1): Dereference null return value (NULL_RETURNS)
 dereference: Dereferencing a pointer that might be null "cur" when calling
 "MDCache::replicate_inode(CInode *, int, ceph::bufferlist &)"

Add assert to check for return value from get_inode() as done in other places.

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

index f90df94efb2f8a57de3982325ac5e5043ebfa68d..14416c62986c9c4afce92bf6a2d010331b8555a7 100644 (file)
@@ -10112,6 +10112,7 @@ void MDCache::handle_discover(MDiscover *dis)
            << dendl;
 
     cur = get_inode(dis->get_base_ino());
+    assert(cur);
 
     // add root
     reply->starts_with = MDiscoverReply::INODE;