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:
Axel Dörfler 2005-05-03 01:05:20 +00:00
parent 9c3942070a
commit 47729f044c
1 changed files with 5 additions and 0 deletions

View File

@ -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
if (*path == '/') {
if (sRoot == NULL) {
// we're a bit early, aren't we?
return B_ERROR;
}
while (*++path == '/')
;
start = sRoot;