]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client/Client.cc: fix possible NULL pointer dereference
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 15:30:41 +0000 (17:30 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 10 May 2013 22:02:56 +0000 (00:02 +0200)
CID 751332 Dereference null return value (CWE-476)

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

index bddfa0a19968f8abf71b930c01aebfdc814ab093..6947f8b43060ee0defd8f38b32ff609794367f5c 100644 (file)
@@ -6379,6 +6379,9 @@ int Client::get_caps_issued(int fd) {
   Mutex::Locker lock(client_lock);
 
   Fh *f = get_filehandle(fd);
+  if (!f)
+    return -EBADF;
+
   return f->inode->caps_issued();
 }