mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-0 fix NPE in ExternalSymbolResolver when project is null
During import, project can be null in some cases.
This commit is contained in:
parent
247528c7fe
commit
645a7c0d52
2 changed files with 4 additions and 5 deletions
|
@ -23,8 +23,7 @@ import ghidra.app.util.bin.ByteProvider;
|
|||
import ghidra.app.util.bin.format.elf.ElfException;
|
||||
import ghidra.app.util.bin.format.elf.ElfHeader;
|
||||
import ghidra.app.util.importer.MessageLog;
|
||||
import ghidra.framework.model.DomainObject;
|
||||
import ghidra.framework.model.Project;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.options.Options;
|
||||
import ghidra.program.model.lang.Endian;
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
@ -158,8 +157,8 @@ public class ElfLoader extends AbstractLibrarySupportLoader {
|
|||
throws CancelledException, IOException {
|
||||
super.postLoadProgramFixups(loadedPrograms, project, options, messageLog, monitor);
|
||||
|
||||
try (ExternalSymbolResolver esr =
|
||||
new ExternalSymbolResolver(project.getProjectData(), monitor)) {
|
||||
ProjectData projectData = project != null ? project.getProjectData() : null;
|
||||
try (ExternalSymbolResolver esr = new ExternalSymbolResolver(projectData, monitor)) {
|
||||
for (Loaded<Program> loadedProgram : loadedPrograms) {
|
||||
esr.addProgramToFixup(
|
||||
loadedProgram.getProjectFolderPath() + loadedProgram.getName(),
|
||||
|
|
|
@ -160,7 +160,7 @@ public class ExternalSymbolResolver implements Closeable {
|
|||
*/
|
||||
protected Program getLibraryProgram(String libPath) throws CancelledException {
|
||||
Program result = loadedPrograms.get(libPath);
|
||||
if (result == null && !problemLibraries.containsKey(libPath)) {
|
||||
if (result == null && projectData != null && !problemLibraries.containsKey(libPath)) {
|
||||
result = openLibraryFile(projectData.getFile(libPath), libPath);
|
||||
|
||||
if (result != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue