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>
This commit is contained in:
parent
7246240c7c
commit
b000056a5a
1 changed files with 1 additions and 1 deletions
|
@ -1590,7 +1590,7 @@ static int set_request_path_attr(struct inode *rinode, struct dentry *rdentry,
|
||||||
} else if (rpath || rino) {
|
} else if (rpath || rino) {
|
||||||
*ino = rino;
|
*ino = rino;
|
||||||
*ppath = rpath;
|
*ppath = rpath;
|
||||||
*pathlen = strlen(rpath);
|
*pathlen = rpath ? strlen(rpath) : 0;
|
||||||
dout(" path %.*s\n", *pathlen, rpath);
|
dout(" path %.*s\n", *pathlen, rpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue