mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-1778 corrected table null checking for AddressRangeMapDB
This commit is contained in:
parent
58a3e57193
commit
bfe3dcfb95
1 changed files with 13 additions and 1 deletions
|
@ -252,7 +252,7 @@ public class AddressRangeMapDB implements DBListener {
|
|||
*/
|
||||
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)
|
||||
throws CancelledException {
|
||||
if (length <= 0) {
|
||||
if (length <= 0 || rangeMapTable == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -337,6 +337,9 @@ public class AddressRangeMapDB implements DBListener {
|
|||
*/
|
||||
public AddressSet getAddressSet(Field value) {
|
||||
AddressSet set = new AddressSet();
|
||||
if (rangeMapTable == null) {
|
||||
return set;
|
||||
}
|
||||
lock.acquire();
|
||||
try {
|
||||
RecordIterator it = rangeMapTable.indexIterator(VALUE_COL, value, value, true);
|
||||
|
@ -865,6 +868,9 @@ public class AddressRangeMapDB implements DBListener {
|
|||
}
|
||||
|
||||
private DBRecord getRecordAfter(Address address) throws IOException {
|
||||
if (rangeMapTable == null) {
|
||||
return null;
|
||||
}
|
||||
RecordIterator it = new AddressKeyRecordIterator(rangeMapTable, addressMap, address, true);
|
||||
if (it.hasNext()) {
|
||||
return it.next();
|
||||
|
@ -873,6 +879,9 @@ public class AddressRangeMapDB implements DBListener {
|
|||
}
|
||||
|
||||
private DBRecord getRecordAtOrBefore(Address address) throws IOException {
|
||||
if (rangeMapTable == null) {
|
||||
return null;
|
||||
}
|
||||
RecordIterator it = new AddressKeyRecordIterator(rangeMapTable, addressMap, address, false);
|
||||
if (it.hasPrevious()) {
|
||||
return it.previous();
|
||||
|
@ -881,6 +890,9 @@ public class AddressRangeMapDB implements DBListener {
|
|||
}
|
||||
|
||||
private DBRecord getRecordBefore(Address address) throws IOException {
|
||||
if (rangeMapTable == null) {
|
||||
return null;
|
||||
}
|
||||
RecordIterator it = new AddressKeyRecordIterator(rangeMapTable, addressMap, address, true);
|
||||
if (it.hasPrevious()) {
|
||||
return it.previous();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue