From: Danny Al-Gaaf Date: Fri, 10 May 2013 20:08:23 +0000 (+0200) Subject: mds/CDir.cc: fix possible dereference after NULL check X-Git-Tag: v0.63~41^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=437d69ef71b4de4511795a6aa0b3002ee20a4373;p=ceph.git mds/CDir.cc: fix possible dereference after NULL check CID 1019553 Dereference after null check (FORWARD_NULL, CWE-476) Signed-off-by: Danny Al-Gaaf --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 4670a1887eb6..4ef6e8f19fa3 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1574,7 +1574,7 @@ void CDir::_fetched(bufferlist &bl, const string& want_dn) // add inode CInode *in = cache->get_inode(inode.ino, last); if (!in || undef_inode) { - if (undef_inode) + if (undef_inode && in) in->first = first; else in = new CInode(cache, true, first, last);