summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorDavid Zafman <david.zafman@inktank.com>2012-10-25 19:23:46 +0200
committerAlex Elder <elder@inktank.com>2012-10-26 23:35:07 +0200
commitb000056a5a8d3f5a4a9fb80184a7ec14f86a43d4 (patch)
tree90129038f11ab2c0e35e670d7682ff8bac2aebea /fs/ceph/mds_client.c
parentlibceph: avoid NULL kref_put from NULL alloc_msg return (diff)
downloadlinux-b000056a5a8d3f5a4a9fb80184a7ec14f86a43d4.tar.xz
linux-b000056a5a8d3f5a4a9fb80184a7ec14f86a43d4.zip
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/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c2
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);
}