VFS: _kern_open_dir(): Fix NULL path case

It would create an empty path buffer and pass that on to dir_open(),
which accepts NULL, but not empty paths.
This commit is contained in:
Ingo Weinhold 2013-04-05 18:44:12 +02:00
parent daf7cb41c4
commit 5b6fb78c40
1 changed files with 3 additions and 0 deletions

View File

@ -8069,6 +8069,9 @@ _kern_open_dir_entry_ref(dev_t device, ino_t inode, const char* name)
int
_kern_open_dir(int fd, const char* path)
{
if (path == NULL)
return dir_open(fd, NULL, true);;
KPath pathBuffer(path, false, B_PATH_NAME_LENGTH + 1);
if (pathBuffer.InitCheck() != B_OK)
return B_NO_MEMORY;