]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/CDir.cc: fix possible dereference after NULL check 273/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 20:08:23 +0000 (22:08 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 22:02:56 +0000 (00:02 +0200)
CID 1019553 Dereference after null check (FORWARD_NULL, CWE-476)

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

index 4670a1887eb692a13f67daf076dff0891cc5435e..4ef6e8f19fa336e14af3c877040ce83ea58f1d03 100644 (file)
@@ -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);