Ghidra is a software reverse engineering (SRE) framework
GP-5577 avoid indexing large projects
dev74736896e0532f8df9
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/ProjectIndexService.java b/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/ProjectIndexService.javaindex 685395a2a6..b95b0181ec 100644--- a/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/ProjectIndexService.java+++ b/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/ProjectIndexService.java@@ -4,9 +4,9 @@* Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at- *+ ** http://www.apache.org/licenses/LICENSE-2.0- *+ ** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.@@ -20,6 +20,7 @@ import java.util.*;import java.util.function.BiFunction;import ghidra.formats.gfilesystem.FSRL;+import ghidra.framework.main.datatable.ProjectDataTablePanel;import ghidra.framework.model.*;import ghidra.util.Swing;import ghidra.util.task.TaskMonitor;@@ -119,7 +120,7 @@ public class ProjectIndexService implements DomainFolderChangeListener {private void indexProject(ProjectData projectData, TaskMonitor monitor) {int fileCount = projectData.getFileCount();- if (fileCount < 0) {+ if (fileCount < 0 || fileCount > ProjectDataTablePanel.MAX_FILE_COUNT) {return;}monitor.initialize(fileCount, "Indexing Project Metadata");diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatable/ProjectDataTablePanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatable/ProjectDataTablePanel.javaindex 454346a554..d09c92b596 100644--- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatable/ProjectDataTablePanel.java+++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatable/ProjectDataTablePanel.java@@ -45,7 +45,7 @@ public class ProjectDataTablePanel extends JPanel {private static final String MAX_FILE_COUNT_PROPERTY = "ProjectDataTable.maxFileCount";private static final int MAX_FILE_COUNT_DEFAULT = 2000;- private static int maxFileCount = loadMaxFileCount();+ public static final int MAX_FILE_COUNT = loadMaxFileCount();private FrontEndPlugin plugin;private PluginTool tool;@@ -190,7 +190,7 @@ public class ProjectDataTablePanel extends JPanel {int fileCount = projectData.getFileCount();- if (fileCount < 0 || fileCount > maxFileCount) {+ if (fileCount < 0 || fileCount > MAX_FILE_COUNT) {capacityExceeded = true;this.projectData.removeDomainFolderChangeListener(changeListener);model.setProjectData(null);