Bug 183871
Crash on "Show hidden files and directories" [@ nsFileView::SetDirectory(nsIFile*) ] fix: don't let files be initialized with relative paths. also fix the directory service to not do that. r=dougt sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@150734 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -270,6 +270,9 @@ nsLocalFile::InitWithNativePath(const nsACString &filePath)
|
||||
}
|
||||
|
||||
mPath = homePath + Substring(filePath, 1, filePath.Length() - 1);
|
||||
} else if (filePath.IsEmpty() || filePath.First() != '/') {
|
||||
NS_ERROR("Relative paths not allowed");
|
||||
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
|
||||
} else {
|
||||
mPath = filePath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user