From 68e64c7ab03104b2464814ec3ddcf57f008eabac Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Wed, 2 Jan 2013 16:26:57 +0100 Subject: [PATCH] nfs4: Expect file system root path to be NULL --- src/add-ons/kernel/file_systems/nfs4/FileSystem.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/add-ons/kernel/file_systems/nfs4/FileSystem.cpp b/src/add-ons/kernel/file_systems/nfs4/FileSystem.cpp index 66bb163f33..caf4037ac0 100644 --- a/src/add-ons/kernel/file_systems/nfs4/FileSystem.cpp +++ b/src/add-ons/kernel/file_systems/nfs4/FileSystem.cpp @@ -60,17 +60,19 @@ FileSystem::~FileSystem() static const char* GetPath(const char* root, const char* path) { - ASSERT(root != NULL); ASSERT(path != NULL); int slash = 0; int i; for (i = 0; path[i] != '\0'; i++) { - if (path[i] != root[i] || root[i] == '\0') - break; - if (path[i] == '/') slash = i; + + if (root == NULL) + break; + + if (path[i] != root[i] || root[i] == '\0') + break; } if (path[i] == '\0')