nfs4: Expect file system root path to be NULL
This commit is contained in:
@@ -60,17 +60,19 @@ FileSystem::~FileSystem()
|
|||||||
static const char*
|
static const char*
|
||||||
GetPath(const char* root, const char* path)
|
GetPath(const char* root, const char* path)
|
||||||
{
|
{
|
||||||
ASSERT(root != NULL);
|
|
||||||
ASSERT(path != NULL);
|
ASSERT(path != NULL);
|
||||||
|
|
||||||
int slash = 0;
|
int slash = 0;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; path[i] != '\0'; i++) {
|
for (i = 0; path[i] != '\0'; i++) {
|
||||||
if (path[i] != root[i] || root[i] == '\0')
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (path[i] == '/')
|
if (path[i] == '/')
|
||||||
slash = i;
|
slash = i;
|
||||||
|
|
||||||
|
if (root == NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (path[i] != root[i] || root[i] == '\0')
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path[i] == '\0')
|
if (path[i] == '\0')
|
||||||
|
|||||||
Reference in New Issue
Block a user