mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GP-3498 - Fixed IndexOutOfBoundsException
This commit is contained in:
parent
d6fa1d9768
commit
05aac4b81e
1 changed files with 5 additions and 1 deletions
|
@ -51,7 +51,6 @@ public class DecompilerFieldAccess extends DecompilerVariable {
|
|||
DataType dt = field.getDataType();
|
||||
dt = getBaseType(dt);
|
||||
if (!(dt instanceof Composite)) {
|
||||
// can the dt be a pointer?
|
||||
Msg.error(this, "Have a field for a type that is not a Composite type");
|
||||
return dt;
|
||||
}
|
||||
|
@ -65,6 +64,11 @@ public class DecompilerFieldAccess extends DecompilerVariable {
|
|||
}
|
||||
}
|
||||
|
||||
int n = composite.getNumComponents();
|
||||
if (offset >= n) {
|
||||
// how sure when this condition can happen, but we have seen this in the wild
|
||||
return null;
|
||||
}
|
||||
DataTypeComponent component = composite.getComponent(offset);
|
||||
if (component == null) {
|
||||
return null; // not sure what else to do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue