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
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