Fixed a possible bug in path_to_vnode(): if called before a root
file system has been mounted, it would have crashed (that for example happened if you deleted the kernel settings file...). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12547 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1449,6 +1449,11 @@ path_to_vnode(char *path, bool traverseLink, struct vnode **_vnode, bool kernel)
|
|||||||
|
|
||||||
// figure out if we need to start at root or at cwd
|
// figure out if we need to start at root or at cwd
|
||||||
if (*path == '/') {
|
if (*path == '/') {
|
||||||
|
if (sRoot == NULL) {
|
||||||
|
// we're a bit early, aren't we?
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
while (*++path == '/')
|
while (*++path == '/')
|
||||||
;
|
;
|
||||||
start = sRoot;
|
start = sRoot;
|
||||||
|
|||||||
Reference in New Issue
Block a user