Bug 1354308 - Entries API must support patches containing '..', r=froydnj
This commit is contained in:
@@ -89,9 +89,17 @@ FileSystemSecurity::ContentProcessHasAccessTo(ContentParentId aId,
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
AssertIsInMainProcess();
|
||||
|
||||
if (FindInReadable(NS_LITERAL_STRING(".."), aPath)) {
|
||||
#if defined(XP_WIN)
|
||||
if (StringBeginsWith(aPath, NS_LITERAL_STRING("..\\")) ||
|
||||
FindInReadable(NS_LITERAL_STRING("\\..\\"), aPath)) {
|
||||
return false;
|
||||
}
|
||||
#elif defined(XP_UNIX)
|
||||
if (StringBeginsWith(aPath, NS_LITERAL_STRING("../")) ||
|
||||
FindInReadable(NS_LITERAL_STRING("/../"), aPath)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsTArray<nsString>* paths;
|
||||
if (!mPaths.Get(aId, &paths)) {
|
||||
|
||||
Reference in New Issue
Block a user