]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Added NULL check before dereference 16751/head
authoramitkuma <amitkuma@redhat.com>
Wed, 2 Aug 2017 17:03:33 +0000 (22:33 +0530)
committeramitkuma <amitkuma@redhat.com>
Wed, 2 Aug 2017 17:03:33 +0000 (22:33 +0530)
Fixed:
** 1405280 Explicit null dereferenced
CID 1405280 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
20. var_deref_model: Passing null pointer diri to check_access, which dereferences it.

Signed-off-by: Amit Kumar amitkuma@redhat.com
src/mds/Server.cc

index cf32c95f6864f4a9e3b59fba72a5a0a905043c49..58702558b5b96b3a1e565a93d5768ea55fa1673e 100644 (file)
@@ -3095,9 +3095,11 @@ void Server::handle_client_lookup_ino(MDRequestRef& mdr,
     if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
       return;
 
-    // need read access to directory inode
-    if (!check_access(mdr, diri, MAY_READ))
-      return;
+    if (diri != NULL) {
+      // need read access to directory inode
+      if (!check_access(mdr, diri, MAY_READ))
+        return;
+    }
   }
 
   if (want_parent) {