userlandfs: NULL pointer dereference

get_vnode could be called with a NULL privateNode in the kernel, but not
in userlandfs. This would crash in cdda mount code (and from a grep
search, also with several other filesystems).

Now cdda can be mounted with userlandfs, and CDs read that way, but for
some reason there is no CDDB renaming of the tracks in that case.
This commit is contained in:
Adrien Destugues 2014-12-17 15:25:29 +01:00
parent c4793b242c
commit a28398b3a2

View File

@ -204,7 +204,8 @@ get_vnode(fs_volume *_volume, ino_t vnodeID, void **privateNode)
if (error != B_OK)
return error;
*privateNode = ((HaikuKernelNode*)foundNode)->private_node;
if (privateNode)
*privateNode = ((HaikuKernelNode*)foundNode)->private_node;
return B_OK;
}