mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-1090 corrected NPE related to recent change. Check for existing data
before attempted creation.
This commit is contained in:
parent
a05125de6d
commit
d89b1f5bdc
2 changed files with 12 additions and 5 deletions
|
@ -1962,7 +1962,11 @@ class ElfProgramBuilder extends MemorySectionResolver implements ElfLoadHelper {
|
|||
if (length == 0) {
|
||||
length = 1;
|
||||
}
|
||||
program.getListing().createData(address, Undefined.getUndefinedDataType(length));
|
||||
Data d = listing.getDefinedDataAt(address);
|
||||
if (d != null && d.getLength() == length) {
|
||||
return d;
|
||||
}
|
||||
listing.createData(address, Undefined.getUndefinedDataType(length));
|
||||
}
|
||||
catch (CodeUnitInsertionException e) {
|
||||
Msg.warn(this, "ELF data markup conflict at " + address);
|
||||
|
|
|
@ -369,18 +369,21 @@ public abstract class MemorySectionResolver {
|
|||
comment = comment + " - displaced by " + priorityBlock.getName();
|
||||
}
|
||||
}
|
||||
// As an overlay no conflict should ever occur
|
||||
block = createInitializedBlock(section.key, true, blockName, physicalStartAddr,
|
||||
fileOffset, rangeSize, comment, section.isReadable(), section.isWritable(),
|
||||
section.isExecute(), monitor);
|
||||
}
|
||||
else {
|
||||
block = createInitializedBlock(section.key, false, blockName, physicalStartAddr,
|
||||
fileOffset, rangeSize, section.getComment(), section.isReadable(),
|
||||
section.isWritable(), section.isExecute(), monitor);
|
||||
}
|
||||
if (block != null) {
|
||||
minAddr = block.getStart();
|
||||
maxAddr = block.getEnd();
|
||||
}
|
||||
else {
|
||||
// block may be null due to unexpected conflict or pruning - allow to continue
|
||||
block = createInitializedBlock(section.key, false, blockName, physicalStartAddr,
|
||||
fileOffset, rangeSize, section.getComment(), section.isReadable(),
|
||||
section.isWritable(), section.isExecute(), monitor);
|
||||
minAddr = physicalStartAddr;
|
||||
maxAddr = physicalStartAddr.addNoWrap(rangeSize - 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue