mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Improved check that prevents Eclipse projects from being created within
the Ghidra installation directory Closes #2298
This commit is contained in:
parent
0cdc722921
commit
f3ba1ed000
2 changed files with 14 additions and 5 deletions
|
@ -37,6 +37,7 @@ import ghidradev.EclipseMessageUtils;
|
|||
import ghidradev.ghidraprojectcreator.utils.GhidraModuleUtils;
|
||||
import ghidradev.ghidraprojectcreator.utils.GhidraModuleUtils.ModuleTemplateType;
|
||||
import ghidradev.ghidraprojectcreator.wizards.pages.*;
|
||||
import utilities.util.FileUtilities;
|
||||
|
||||
/**
|
||||
* Wizard to create a new Ghidra module project.
|
||||
|
@ -160,10 +161,10 @@ public class CreateGhidraModuleProjectWizard extends Wizard implements INewWizar
|
|||
* @return True if the data returned from the wizard pages are valid; otherwise, false
|
||||
*/
|
||||
private boolean validate() {
|
||||
if (projectPage.getProjectDir().getAbsolutePath().startsWith(
|
||||
ghidraInstallationPage.getGhidraInstallDir().getAbsolutePath())) {
|
||||
if (FileUtilities.isPathContainedWithin(ghidraInstallationPage.getGhidraInstallDir(),
|
||||
projectPage.getProjectDir())) {
|
||||
EclipseMessageUtils.showErrorDialog("Invalid Project Root Directory",
|
||||
"Project root directory cannot reside inside of the selected Ghidra installation directory.");
|
||||
"Project root directory cannot reside inside of the selected Ghidra installation directory.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue