From 75c2064c1a4dc0a8bf9ed998bf45f7b814fa8ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 28 Sep 2002 02:19:26 +0000 Subject: [PATCH] Fixed the crashing bug in the VFS - we can't make any assumptions about the "device" parameter of fs_mount. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1225 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/fs/vfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kernel/core/fs/vfs.c b/src/kernel/core/fs/vfs.c index d09beeaae5..913efcf516 100755 --- a/src/kernel/core/fs/vfs.c +++ b/src/kernel/core/fs/vfs.c @@ -2898,9 +2898,12 @@ fs_mount(char *path, const char *device, const char *fsName, void *args, bool ke vnode_id root_id; int err = 0; - FUNCTION(("vfs_mount: entry. path = '%s', fs_name = '%s'\n", path, fsName)); + FUNCTION(("fs_mount: entry. path = '%s', fs_name = '%s'\n", path, fsName)); - if (device[0] == '\0' || fsName[0] == '\0') + // The path is always safe, we just have to make sure that fsName is + // almost valid - we can't make any assumptions about device and args, + // though. + if (fsName == NULL || fsName[0] == '\0') return B_BAD_VALUE; mutex_lock(&gMountOpMutex);