From: Danny Al-Gaaf Date: Sat, 1 Mar 2014 11:10:56 +0000 (+0100) Subject: MDCache::handle_discover: fix null pointer deref X-Git-Tag: v0.78~108^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=93c09836fe7aeebc8cee0dff47ccd94f3a2c42e8;p=ceph.git MDCache::handle_discover: fix null pointer deref 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 --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index f90df94efb2f..14416c62986c 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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;