diff options
author | David Zafman <david.zafman@inktank.com> | 2012-10-25 13:23:46 -0400 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-10-26 17:35:07 -0400 |
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, | |||
1590 | } else if (rpath || rino) { | 1590 | } else if (rpath || rino) { |
1591 | *ino = rino; | 1591 | *ino = rino; |
1592 | *ppath = rpath; | 1592 | *ppath = rpath; |
1593 | *pathlen = strlen(rpath); | 1593 | *pathlen = rpath ? strlen(rpath) : 0; |
1594 | dout(" path %.*s\n", *pathlen, rpath); | 1594 | dout(" path %.*s\n", *pathlen, rpath); |
1595 | } | 1595 | } |
1596 | 1596 | ||