GP-186 - Ghidra Dev Plugin - applied previous fix to an additional file

This commit is contained in:
dragonmacher 2020-09-30 15:15:00 -04:00
parent b816f4a939
commit 947c99a170

View file

@ -33,6 +33,7 @@ import ghidra.GhidraApplicationLayout;
import ghidradev.EclipseMessageUtils; import ghidradev.EclipseMessageUtils;
import ghidradev.ghidraprojectcreator.utils.GhidraScriptUtils; import ghidradev.ghidraprojectcreator.utils.GhidraScriptUtils;
import ghidradev.ghidraprojectcreator.wizards.pages.*; import ghidradev.ghidraprojectcreator.wizards.pages.*;
import utilities.util.FileUtilities;
/** /**
* Wizard to create a new Ghidra scripting project. * Wizard to create a new Ghidra scripting project.
@ -147,8 +148,8 @@ public class CreateGhidraScriptProjectWizard extends Wizard implements INewWizar
* @return True if the data returned from the wizard pages are valid; otherwise, false * @return True if the data returned from the wizard pages are valid; otherwise, false
*/ */
private boolean validate() { private boolean validate() {
if (projectPage.getProjectDir().getAbsolutePath().startsWith( if (FileUtilities.isPathContainedWithin(ghidraInstallationPage.getGhidraInstallDir(),
ghidraInstallationPage.getGhidraInstallDir().getAbsolutePath())) { projectPage.getProjectDir())) {
EclipseMessageUtils.showErrorDialog("Invalid Project Root Directory", 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 false;