From 437d69ef71b4de4511795a6aa0b3002ee20a4373 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Fri, 10 May 2013 22:08:23 +0200 Subject: [PATCH] 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 --- src/mds/CDir.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.3