diff options
author | David Zafman <david.zafman@inktank.com> | 2012-10-25 10:23:46 -0700 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-10-26 16:35:07 -0500 |
commit | b000056a5a8d3f5a4a9fb80184a7ec14f86a43d4 (patch) | |
tree | 90129038f11ab2c0e35e670d7682ff8bac2aebea /fs/ceph | |
parent | 7246240c7c186542f73af4fadc744d66440f616f (diff) |
ceph: Fix NULL ptr crash in strlen()
set_request_path_attr() checks for NULL ptr before calling strlen()
This fixes http://tracker.newdream.net/issues/3404
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/mds_client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 1bcf712655d9..62d2342eb267 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1590,7 +1590,7 @@ static int set_request_path_attr(struct inode *rinode, struct dentry *rdentry, } else if (rpath || rino) { *ino = rino; *ppath = rpath; - *pathlen = strlen(rpath); + *pathlen = rpath ? strlen(rpath) : 0; dout(" path %.*s\n", *pathlen, rpath); } |