Fix strange validity check in BDirectory::Contains(). If either path ends up as

invalid it must not be used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28015 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2008-10-12 23:02:13 +00:00
parent fd630a4552
commit e84abff2bd

View File

@ -505,7 +505,7 @@ BDirectory::Contains(const BEntry *entry, int32 nodeFlags) const
// the entry and check, if the latter is a prefix of the first one.
BPath dirPath(this, ".", true);
BPath entryPath(entry);
if (dirPath.InitCheck() == B_OK && entryPath.InitCheck() != B_OK)
if (dirPath.InitCheck() != B_OK || entryPath.InitCheck() != B_OK)
return false;
return !strncmp(dirPath.Path(), entryPath.Path(), strlen(dirPath.Path()));