[PATCH 1/2] fix null deref when callback invoked en route from readdir_r rather than readdirplus_r

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Brian Chrisman <brchrisman@xxxxxxxxx>
---
 src/client/Client.cc |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/client/Client.cc b/src/client/Client.cc
index 8b8fcf1..dbac2c9 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -4330,8 +4330,12 @@ static int _readdir_single_dirent_cb(void *p, struct dirent *de, struct stat *st
     return -1;
 
   *c->de = *de;
-  *c->st = *st;
-  *c->stmask = stmask;
+  if (c->st) {
+    *c->st = *st;
+  }
+  if (c->stmask) {
+    *c->stmask = stmask;
+  }
   c->full = true;
   return 0;  
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux