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:
cbiesinger@web.de
2003-12-25 22:05:01 +00:00
parent 2316fd0c5f
commit a7132979a9
2 changed files with 21 additions and 20 deletions

View File

@@ -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;
}